Struct Result<T, E>
Implements
System.IEquatable<
Result<T, E>>
Inherited Members
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: LibSugar.dll
Syntax
public struct Result<T, E> : IEquatable<Result<T, E>>
Type Parameters
Properties
|
Improve this Doc
View Source
Error
Declaration
public readonly E Error { get; }
Property Value
|
Improve this Doc
View Source
IsErr
Declaration
public readonly bool IsErr { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsOk
Declaration
public readonly bool IsOk { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Value
Declaration
public readonly T Value { get; }
Property Value
Methods
|
Improve this Doc
View Source
And<U>(Result<U, E>)
Declaration
public Result<U, E> And<U>(Result<U, E> o)
Parameters
Type |
Name |
Description |
Result<U, E> |
o |
|
Returns
Type Parameters
|
Improve this Doc
View Source
And<U>(Func<Result<U, E>>)
Declaration
public Result<U, E> And<U>(Func<Result<U, E>> o)
Parameters
Type |
Name |
Description |
System.Func<Result<U, E>> |
o |
|
Returns
Type Parameters
|
Improve this Doc
View Source
Equals(Result<T, E>)
Declaration
public bool Equals(Result<T, E> other)
Parameters
Type |
Name |
Description |
Result<T, E> |
other |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.ValueType.Equals(System.Object)
|
Improve this Doc
View Source
Err(E)
Declaration
public static Result<T, E> Err(E err)
Parameters
Type |
Name |
Description |
E |
err |
|
Returns
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.ValueType.GetHashCode()
|
Improve this Doc
View Source
MapErr<U>(Func<E, U>)
Declaration
public Result<T, U> MapErr<U>(Func<E, U> f)
Parameters
Type |
Name |
Description |
System.Func<E, U> |
f |
|
Returns
Type Parameters
|
Improve this Doc
View Source
MapOk<U>(Func<T, U>)
Declaration
public Result<U, E> MapOk<U>(Func<T, U> f)
Parameters
Type |
Name |
Description |
System.Func<T, U> |
f |
|
Returns
Type Parameters
|
Improve this Doc
View Source
Ok(T)
Declaration
public static Result<T, E> Ok(T val)
Parameters
Type |
Name |
Description |
T |
val |
|
Returns
|
Improve this Doc
View Source
Or(Result<T, E>)
Declaration
public Result<T, E> Or(Result<T, E> o)
Parameters
Type |
Name |
Description |
Result<T, E> |
o |
|
Returns
|
Improve this Doc
View Source
Or(Func<Result<T, E>>)
Declaration
public Result<T, E> Or(Func<Result<T, E>> o)
Parameters
Type |
Name |
Description |
System.Func<Result<T, E>> |
o |
|
Returns
Operators
|
Improve this Doc
View Source
BitwiseAnd(Result<T, E>, Result<T, E>)
Declaration
public static Result<T, E> operator &(Result<T, E> left, Result<T, E> right)
Parameters
Returns
|
Improve this Doc
View Source
BitwiseOr(Result<T, E>, Result<T, E>)
Declaration
public static Result<T, E> operator |(Result<T, E> left, Result<T, E> right)
Parameters
Returns
|
Improve this Doc
View Source
Equality(Result<T, E>, Result<T, E>)
Declaration
public static bool operator ==(Result<T, E> left, Result<T, E> right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Inequality(Result<T, E>, Result<T, E>)
Declaration
public static bool operator !=(Result<T, E> left, Result<T, E> right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IEquatable<T>
Extension Methods
Sugar.Borrow<T>(T)
Sugar.Owner<T>(T)