Table of Contents

Class BindZipExtensionsAsync

Namespace
Trellis
Assembly
Trellis.Results.dll

Async BindZip extensions where both input and function are async (Task).

public static class BindZipExtensionsAsync
Inheritance
BindZipExtensionsAsync
Inherited Members

Methods

BindZipAsync<T1, T2>(Task<Result<T1>>, Func<T1, Task<Result<T2>>>)

Asynchronously binds an async function to the awaited Result value and zips both values into a tuple.

public static Task<Result<(T1, T2)>> BindZipAsync<T1, T2>(this Task<Result<T1>> resultTask, Func<T1, Task<Result<T2>>> func)

Parameters

resultTask Task<Result<T1>>

The task containing the result to bind and zip.

func Func<T1, Task<Result<T2>>>

The async function to call if the result is successful.

Returns

Task<Result<(T1, T2)>>

A tuple result combining both values on success; otherwise the failure.

Type Parameters

T1

Type of the input result value.

T2

Type of the new result value.

BindZipAsync<T1, T2>(Task<Result<T1>>, Func<T1, Result<T2>>)

Asynchronously binds a function to the awaited Result value and zips both values into a tuple.

public static Task<Result<(T1, T2)>> BindZipAsync<T1, T2>(this Task<Result<T1>> resultTask, Func<T1, Result<T2>> func)

Parameters

resultTask Task<Result<T1>>

The task containing the result to bind and zip.

func Func<T1, Result<T2>>

The synchronous function to call if the result is successful.

Returns

Task<Result<(T1, T2)>>

A tuple result combining both values on success; otherwise the failure.

Type Parameters

T1

Type of the input result value.

T2

Type of the new result value.

BindZipAsync<T1, T2>(ValueTask<Result<T1>>, Func<T1, ValueTask<Result<T2>>>)

Binds an async function to the awaited ValueTask Result value and zips both values into a tuple.

public static ValueTask<Result<(T1, T2)>> BindZipAsync<T1, T2>(this ValueTask<Result<T1>> resultTask, Func<T1, ValueTask<Result<T2>>> func)

Parameters

resultTask ValueTask<Result<T1>>

The ValueTask containing the result to bind and zip.

func Func<T1, ValueTask<Result<T2>>>

The async function to call if the result is successful.

Returns

ValueTask<Result<(T1, T2)>>

A ValueTask tuple result combining both values on success; otherwise the failure.

Type Parameters

T1

Type of the input result value.

T2

Type of the new result value.

BindZipAsync<T1, T2>(ValueTask<Result<T1>>, Func<T1, Result<T2>>)

Binds a synchronous function to the awaited ValueTask Result value and zips both values into a tuple.

public static ValueTask<Result<(T1, T2)>> BindZipAsync<T1, T2>(this ValueTask<Result<T1>> resultTask, Func<T1, Result<T2>> func)

Parameters

resultTask ValueTask<Result<T1>>

The ValueTask containing the result to bind and zip.

func Func<T1, Result<T2>>

The synchronous function to call if the result is successful.

Returns

ValueTask<Result<(T1, T2)>>

A tuple result combining both values on success; otherwise the failure.

Type Parameters

T1

Type of the input result value.

T2

Type of the new result value.

BindZipAsync<T1, T2>(Result<T1>, Func<T1, Task<Result<T2>>>)

Binds an async function to the Result value and zips both values into a tuple.

public static Task<Result<(T1, T2)>> BindZipAsync<T1, T2>(this Result<T1> result, Func<T1, Task<Result<T2>>> func)

Parameters

result Result<T1>

The result to bind and zip.

func Func<T1, Task<Result<T2>>>

The async function to call if the result is successful.

Returns

Task<Result<(T1, T2)>>

A tuple result combining both values on success; otherwise the failure.

Type Parameters

T1

Type of the input result value.

T2

Type of the new result value.

BindZipAsync<T1, T2>(Result<T1>, Func<T1, ValueTask<Result<T2>>>)

Binds an async function to the Result value and zips both values into a tuple (ValueTask variant).

public static ValueTask<Result<(T1, T2)>> BindZipAsync<T1, T2>(this Result<T1> result, Func<T1, ValueTask<Result<T2>>> func)

Parameters

result Result<T1>

The result to bind and zip.

func Func<T1, ValueTask<Result<T2>>>

The async function to call if the result is successful.

Returns

ValueTask<Result<(T1, T2)>>

A ValueTask tuple result combining both values on success; otherwise the failure.

Type Parameters

T1

Type of the input result value.

T2

Type of the new result value.