Struct Awaitable<T, TAwaiter>
Represents awaitable concept type.
Inherited Members
Namespace: DotNext.Runtime.CompilerServices
Assembly: DotNext.Reflection.dll
Syntax
public struct Awaitable<T, TAwaiter>
where TAwaiter : ICriticalNotifyCompletion
Type Parameters
| Name | Description |
|---|---|
| T | The constrained type. |
| TAwaiter | The type constrained with concept Awaiter<TAwaiter>. |
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> GetAwaiter()
Returns
| Type | Description |
|---|---|
| Awaiter<TAwaiter> | 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> to T)
Gets underlying awaitable object.
Declaration
public static implicit operator T(in Awaitable<T, TAwaiter> awaitable)
Parameters
| Type | Name | Description |
|---|---|---|
| Awaitable<T, TAwaiter> | awaitable | Awaitable object container. |
Returns
| Type | Description |
|---|---|
| T |