Table of Contents

Class Result

Namespace
Badeend
Assembly
Badeend.Result.dll

Supporting methods for Result<TValue, TFailure>.

public static class Result
Inheritance
Result
Inherited Members

Methods

Failure<TValue, TFailure>(TFailure)

Create a failure result.

[Pure]
public static Result<TValue, TFailure> Failure<TValue, TFailure>(TFailure failure)

Parameters

failure TFailure

Returns

Result<TValue, TFailure>

Type Parameters

TValue
TFailure

GetFailureRefOrDefaultRef<TValue, TFailure>(ref readonly Result<TValue, TFailure>)

Attempt to get a readonly reference to the operation's failure value. Returns a reference to TFailure's default value when the operation succeeded.

[Pure]
public static ref readonly TFailure GetFailureRefOrDefaultRef<TValue, TFailure>(ref readonly Result<TValue, TFailure> result)

Parameters

result Result<TValue, TFailure>

Returns

TFailure

Type Parameters

TValue
TFailure

GetValueRefOrDefaultRef<TValue, TFailure>(ref readonly Result<TValue, TFailure>)

Attempt to get a readonly reference the operation's success value. Returns a reference to TValue's default value when the operation failed.

[Pure]
public static ref readonly TValue GetValueRefOrDefaultRef<TValue, TFailure>(ref readonly Result<TValue, TFailure> result)

Parameters

result Result<TValue, TFailure>

Returns

TValue

Type Parameters

TValue
TFailure

Success<TValue, TFailure>(TValue)

Create a successful result.

[Pure]
public static Result<TValue, TFailure> Success<TValue, TFailure>(TValue value)

Parameters

value TValue

Returns

Result<TValue, TFailure>

Type Parameters

TValue
TFailure