System.Threading.Tasks.Extensions by Microsoft

<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.0" />

 ValueTask<TResult>

public struct ValueTask<TResult> : IEquatable<ValueTask<TResult>>
Provides a value type that can represent a synchronously available value or a task object.
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 a TResult result value.

public ValueTask(Task<TResult> task)

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

public ValueTask(IValueTaskSource<TResult> source, short token)

Initialize the ValueTask<T> with a IValueTaskSource<T> object 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 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.

public ConfiguredValueTaskAwaitable<TResult> ConfigureAwait(bool continueOnCapturedContext)

Configures an awaiter for this ValueTask<T>.

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 ValueTask<T>.

public ValueTask<TResult> Preserve()

Gets a ValueTask<T> that may be used at any point in the future.