Table of Contents

Class ToMaybeExtensionsAsync

Namespace
Trellis
Assembly
Trellis.Results.dll

Provides asynchronous extension methods for converting Result{T} to Maybe{T}.

public static class ToMaybeExtensionsAsync
Inheritance
ToMaybeExtensionsAsync
Inherited Members

Methods

ToMaybeAsync<TValue>(Task<Result<TValue>>)

Asynchronously converts a Result<TValue> wrapped in a Task to a Maybe<T>.

public static Task<Maybe<TValue>> ToMaybeAsync<TValue>(this Task<Result<TValue>> resultTask) where TValue : notnull

Parameters

resultTask Task<Result<TValue>>

The task containing the result to convert.

Returns

Task<Maybe<TValue>>

A Maybe containing the value if success; otherwise None.

Type Parameters

TValue

Type of the result value.

ToMaybeAsync<TValue>(ValueTask<Result<TValue>>)

Asynchronously converts a Result<TValue> wrapped in a ValueTask to a Maybe<T>.

public static ValueTask<Maybe<TValue>> ToMaybeAsync<TValue>(this ValueTask<Result<TValue>> resultTask) where TValue : notnull

Parameters

resultTask ValueTask<Result<TValue>>

The value task containing the result to convert.

Returns

ValueTask<Maybe<TValue>>

A Maybe containing the value if success; otherwise None.

Type Parameters

TValue

Type of the result value.