Struct Awaitable<T, TAwaiter, TResult>
Represents awaitable concept type for the task type with non-void result.
Inherited Members
Namespace: DotNext.Runtime.CompilerServices
Assembly: DotNext.Reflection.dll
Syntax
public struct Awaitable<T, TAwaiter, TResult>
where TAwaiter : ICriticalNotifyCompletion
Type Parameters
Name | Description |
---|---|
T | The constrained type. |
TAwaiter | The type constrained with concept Awaiter<TAwaiter>. |
TResult | The type of asynchronous result. |
Constructors
| Improve this Doc View SourceAwaitable(T)
Wraps value of type T
into awaitable value compatible with await expression.
Declaration
public Awaitable(T awaitable)
Parameters
Type | Name | Description |
---|---|---|
T | awaitable | Underlying awaitable object. |
Methods
| Improve this Doc View SourceGetAwaiter()
Gets awaiter used to await asynchronous result represented by type T
.
Declaration
public Awaiter<TAwaiter, TResult> GetAwaiter()
Returns
Type | Description |
---|---|
Awaiter<TAwaiter, TResult> | An awaiter instance. |
GetAwaiter(T)
Gets awaiter used to await asynchronous result represented by type T
.
Declaration
public static TAwaiter GetAwaiter(in T obj)
Parameters
Type | Name | Description |
---|---|---|
T | obj | The object representing asynchronous computing. |
Returns
Type | Description |
---|---|
TAwaiter | An awaiter instance. |
Operators
| Improve this Doc View SourceImplicit(Awaitable<T, TAwaiter, TResult> to T)
Gets underlying awaitable object.
Declaration
public static implicit operator T(in Awaitable<T, TAwaiter, TResult> awaitable)
Parameters
Type | Name | Description |
---|---|---|
Awaitable<T, TAwaiter, TResult> | awaitable | Awaitable object container. |
Returns
Type | Description |
---|---|
T |