Struct Result<T>.Failure
Represents unsuccessful result.
Inherited Members
Namespace: DotNext
Assembly: DotNext.dll
Syntax
public readonly struct Result<T>.Failure : IResultMonad<T>, IResultMonad<T, Exception>, IOptionMonad<T>, ISupplier<object?>, IFunctional
Constructors
View SourceFailure(Exception)
Represents unsuccessful result.
Declaration
public Failure(Exception error)
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | error | The exception that represents the error. |
Properties
View SourceError
Gets the underlying exception.
Declaration
public Exception Error { get; }
Property Value
| Type | Description |
|---|---|
| Exception |
Operators
View Sourceimplicit operator Result<T>(Failure)
Converts successful result to Result<T> type.
Declaration
public static implicit operator Result<T>(Result<T>.Failure result)
Parameters
| Type | Name | Description |
|---|---|---|
| Result<T>.Failure | result | The result to convert. |
Returns
| Type | Description |
|---|---|
| Result<T> | An instance of Result<T> that represents the successful result. |
implicit operator Failure(Exception)
Converts the exception to the monad.
Declaration
public static implicit operator Result<T>.Failure(Exception error)
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | error | The value to convert. |
Returns
| Type | Description |
|---|---|
| Result<T>.Failure | The monad that represents the failure. |