OptionalResult<A> Struct

Represents the result of an operation:

Some(A) | None | Exception


DECLARATION
public struct OptionalResult<A> : IEquatable<OptionalResult<A>>
NAMESPACE
LanguageExt

Constructors

OptionalResult(Option<A>)
SUMMARY

Constructor of a concrete value

PARAMETERS
value
Option<A>
DECLARATION
[Pure]
public ctor OptionalResult(Option<A> value)
OptionalResult(Exception)
SUMMARY

Constructor of an error value

PARAMETERS
e
Exception
DECLARATION
[Pure]
public ctor OptionalResult(Exception e)

Fields

Bottom
DECLARATION
public static readonly OptionalResult<A> Bottom
None
DECLARATION
public static readonly OptionalResult<A> None

Properties

IsBottom
SUMMARY

True if the struct is in an invalid state

DECLARATION
[Pure]
public bool IsBottom { get; }
RETURNS
bool
IsFaulted
SUMMARY

True if the result is faulted

DECLARATION
[Pure]
public bool IsFaulted { get; }
RETURNS
bool
IsFaultedOrNone
SUMMARY

True if the result is faulted

DECLARATION
[Pure]
public bool IsFaultedOrNone { get; }
RETURNS
bool

Methods

Equals(OptionalResult<A>)
SUMMARY

Equality check

PARAMETERS
other
OptionalResult<A>
DECLARATION
[Pure]
public bool Equals(OptionalResult<A> other)
RETURNS
bool
Equals(object)
SUMMARY

Equality check

PARAMETERS
obj
object
DECLARATION
[Pure]
public override bool Equals(object obj)
RETURNS
bool
GetHashCode()
SUMMARY

Get hash code for bound value

DECLARATION
[Pure]
public override int GetHashCode()
RETURNS
int
IfFail(A)
PARAMETERS
defaultValue
A
DECLARATION
[Pure]
public A IfFail(A defaultValue)
RETURNS
A
IfFail(Func<Exception, A>)
PARAMETERS
f
Func<Exception, A>
DECLARATION
[Pure]
public Option<A> IfFail(Func<Exception, A> f)
RETURNS
Option<A>
IfFail(Action)
PARAMETERS
f
Action
DECLARATION
public Unit IfFail(Action f)
IfFail(Action<Exception>)
PARAMETERS
f
Action<Exception>
DECLARATION
public Unit IfFail(Action<Exception> f)
IfSucc(Action<A>)
PARAMETERS
f
Action<A>
DECLARATION
public Unit IfSucc(Action<A> f)
Map<B>(Func<A, B>)
PARAMETERS
f
Func<A, B>
DECLARATION
[Pure]
public OptionalResult<B> Map<B>(Func<A, B> f)
RETURNS
OptionalResult<B>
MapAsync<B>(Func<A, Task<B>>)
PARAMETERS
f
Func<A, Task<B>>
DECLARATION
[Pure]
public async Task<OptionalResult<B>> MapAsync<B>(Func<A, Task<B>> f)
RETURNS
Task<OptionalResult<B>>
Match<R>(Func<A, R>, Func<R>, Func<Exception, R>)
PARAMETERS
Some
Func<A, R>
None
Func<R>
Fail
Func<Exception, R>
DECLARATION
[Pure]
public R Match<R>(Func<A, R> Some, Func<R> None, Func<Exception, R> Fail)
RETURNS
R
ToString()
SUMMARY

Convert the value to a showable string

DECLARATION
[Pure]
public override string ToString()
RETURNS
string