Class MaybeTaskAdapterExtensions
- Namespace
- Trellis
- Assembly
- Trellis.Core.dll
Provides adapters that wrap already-computed Maybe<T> values in completed task-like carriers. Useful for disambiguating Task<TResult> versus ValueTask<TResult> overloads at call sites (including LINQ query expressions over async Maybe carriers).
public static class MaybeTaskAdapterExtensions
- Inheritance
-
MaybeTaskAdapterExtensions
- Inherited Members
Methods
AsTask<T>(Maybe<T>)
Wraps the maybe in a completed Task<TResult>.
public static Task<Maybe<T>> AsTask<T>(this Maybe<T> maybe) where T : notnull
Parameters
maybeMaybe<T>The maybe to wrap.
Returns
Type Parameters
TThe optional value type.
AsValueTask<T>(Maybe<T>)
Wraps the maybe in a completed ValueTask<TResult>.
public static ValueTask<Maybe<T>> AsValueTask<T>(this Maybe<T> maybe) where T : notnull
Parameters
maybeMaybe<T>The maybe to wrap.
Returns
Type Parameters
TThe optional value type.