UniTaskCompletionSourceCore Struct
Namespace: Cysharp.Threading.Tasks
Assembly: cs.temp.dll.dll
public struct UniTaskCompletionSourceCore<TResult>
Type Parameters
TResult
Members
Properties
Name | Description |
---|---|
Version | Gets the operation version. |
Methods
Name | Description |
---|---|
GetResult(Int16) | Gets the result of the operation. |
GetStatus(Int16) | Gets the status of the operation. |
OnCompleted(Action, Object, Int16) | Schedules the continuation action for this operation. |
Reset() | |
TrySetCanceled(CancellationToken) | |
TrySetException(Exception) | Completes with an error. |
TrySetResult(TResult) | Completes with a successful result. |
UnsafeGetStatus() | Gets the status of the operation without token validation. |
Properties
Version
Gets the operation version.
public readonly short Version { get; }
Property Value
System.Int16
Methods
GetResult(Int16)
Gets the result of the operation.
public TResult GetResult(short token)
Parameters
token
System.Int16
Opaque value that was provided to the UniTask's constructor.
Returns
TResult
GetStatus(Int16)
Gets the status of the operation.
public UniTaskStatus GetStatus(short token)
Parameters
token
System.Int16
Opaque value that was provided to the UniTask's constructor.
Returns
OnCompleted(Action, Object, Int16)
Schedules the continuation action for this operation.
public void OnCompleted(Action<object> continuation, object state, short token)
Parameters
continuation
System.Action<System.Object>
The continuation to invoke when the operation has completed.
state
System.Object
The state object to pass to continuation
when it's invoked.
token
System.Int16
Opaque value that was provided to the UniTask's constructor.
Reset()
TrySetCanceled(CancellationToken)
public bool TrySetCanceled(CancellationToken cancellationToken = default(CancellationToken))
Parameters
cancellationToken
System.Threading.CancellationToken
Returns
System.Boolean
TrySetException(Exception)
Completes with an error.
public bool TrySetException(Exception error)
Parameters
error
System.Exception
The exception.
Returns
System.Boolean
TrySetResult(TResult)
Completes with a successful result.
public bool TrySetResult(TResult result)
Parameters
result
TResult
The result.
Returns
System.Boolean
UnsafeGetStatus()
Gets the status of the operation without token validation.
public UniTaskStatus UnsafeGetStatus()