System.Threading.Tasks.Extensions by Microsoft

<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.0.0-rc2-24027" />

 ValueTask<TResult>

public struct ValueTask<TResult> : IEquatable<ValueTask<TResult>>
Provides a value type that wraps a Task<T> and a TResult, only one of which is used.
public bool IsCanceled { get; }

Gets whether the ValueTask<T> represents a canceled operation.

public bool IsCompleted { get; }

Gets whether the ValueTask<T> represents a completed operation.

public bool IsCompletedSuccessfully { get; }

Gets whether the ValueTask<T> represents a successfully completed operation.

public bool IsFaulted { get; }

Gets whether the ValueTask<T> represents a failed operation.

public TResult Result { get; }

Gets the result.

public ValueTask(TResult result)

Initialize the ValueTask<T> with the result of the successful operation.

public ValueTask(Task<TResult> task)

Initialize the ValueTask<T> with a Task<T> that represents the operation.

public static bool op_Equality(ValueTask<TResult> left, ValueTask<TResult> right)

Returns a value indicating whether two ValueTask<T> values are equal.

public static ValueTask<TResult> op_Implicit(Task<TResult> task)

Implicit operator to wrap a ValueTask<T> around a task.

public static ValueTask<TResult> op_Implicit(TResult result)

Implicit operator to wrap a ValueTask<T> around a result.

public static bool op_Inequality(ValueTask<TResult> left, ValueTask<TResult> right)

Returns a value indicating whether two ValueTask<T> values are not equal.

public Task<TResult> AsTask()

Gets a Task<T> object to represent this ValueTask. It will either return the wrapped task object if one exists, or it'll manufacture a new task object to represent the result.

public ConfiguredValueTaskAwaitable<TResult> ConfigureAwait(bool continueOnCapturedContext)

Configures an awaiter for this value.

public bool Equals(ValueTask<TResult> other)

Returns a value indicating whether this value is equal to a specified ValueTask<T> value.

public ValueTaskAwaiter<TResult> GetAwaiter()

Gets an awaiter for this value.