Struct TaskResult<T>
Represents an awaitable placeholder for a final result of type T.
A TaskResult<T> can be safely awaited multiple times while guaranteeing that
it remains valid, and any side effects are guaranteed to only occur only once.
If Error is not null, awaiting on this TaskResult<T> will throw the exception set in Error. It is highly recommended to check the error value before awaiting the task.
Implements
Inherited Members
Namespace: Snowflake.Installation
Assembly: Snowflake.Framework.Primitives.dll
Syntax
public struct TaskResult<T> : ITaskResult
Type Parameters
| Name | Description |
|---|---|
| T | The type of the result. |
Properties
Description
A description for the execution of the task result. Because this can be dependent on inputs and artifacts, this value is awaitable, but can safely be awaited multiple times.
Declaration
public ValueTask<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| System. |
Error
Enumerating or awaiting AsyncInstallTaskEnumerable<T> or AsyncInstallTask<T> must not throw. Hence, exceptions are wrapped during the resolution of the asynchronous task. If an error occurred, it is set here.
Declaration
public Exception Error { get; }
Property Value
| Type | Description |
|---|---|
| System. |
Name
A string identifier for the result
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| System. |
Methods
GetAwaiter()
Gets the awaiter for this result. TaskResult<T> must be context free, so this awaiter is always configured to not continue on captured context.
Declaration
public ConfiguredValueTaskAwaitable<T>.ConfiguredValueTaskAwaiter GetAwaiter()
Returns
| Type | Description |
|---|---|
| System. |
The awaiter for this TaskResult<T> |
Operators
Implicit(T to TaskResult<T>)
Converts a value of type T to a TaskResult<T>.
Awaiting the resultant TaskResult<T> returns the value.
Declaration
public static implicit operator TaskResult<T>(T t)
Parameters
| Type | Name | Description |
|---|---|---|
| T | t | The value to wrap. |
Returns
| Type | Description |
|---|---|
| Task |
Explicit Interface Implementations
ITaskResult.GetAwaiter()
Declaration
ConfiguredTaskAwaitable<object>.ConfiguredTaskAwaiter ITaskResult.GetAwaiter()
Returns
| Type | Description |
|---|---|
| System. |