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
token
System.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
token
System.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
continuation
System.Action<System.Object>The continuation to invoke when the operation has completed.
state
System.ObjectThe state object to pass to
continuation
when it's invoked.token
System.Int16Opaque value that was provided to the UniTask's constructor.
Reset()
public void 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.ExceptionThe exception.
Returns
- System.Boolean
TrySetResult(TResult)
Completes with a successful result.
public bool TrySetResult(TResult result)
Parameters
result
TResultThe result.
Returns
- System.Boolean
UnsafeGetStatus()
Gets the status of the operation without token validation.
public UniTaskStatus UnsafeGetStatus()