UniTaskCompletionSourceCore<TResult> 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>, 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 short Version { get; }
Property Value
- System.Int16
Methods
GetResult(Int16)
Gets the result of the operation.
public TResult GetResult(short token)
Parameters
tokenSystem.Int16Opaque 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
tokenSystem.Int16Opaque value that was provided to the UniTask's constructor.
Returns
OnCompleted(Action<Object>, Object, Int16)
Schedules the continuation action for this operation.
public void OnCompleted(Action<object> continuation, object state, short token)
Parameters
continuationSystem.Action<System.Object>The continuation to invoke when the operation has completed.
stateSystem.ObjectThe state object to pass to
continuationwhen it's invoked.tokenSystem.Int16Opaque value that was provided to the UniTask's constructor.
Reset()
public void Reset()
TrySetCanceled(CancellationToken)
public bool TrySetCanceled(CancellationToken cancellationToken = null)
Parameters
cancellationTokenCancellationToken
Returns
- System.Boolean
TrySetException(Exception)
Completes with an error.
public bool TrySetException(Exception error)
Parameters
errorSystem.ExceptionThe exception.
Returns
- System.Boolean
TrySetResult(TResult)
Completes with a successful result.
public bool TrySetResult(TResult result)
Parameters
resultTResultThe result.
Returns
- System.Boolean
UnsafeGetStatus()
Gets the status of the operation without token validation.
public UniTaskStatus UnsafeGetStatus()