Search Results for

    Show / Hide Table of Contents

    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)
    Namespace: LibSugar
    Assembly: LibSugar.dll
    Syntax
    public struct Result<T, E> : IEquatable<Result<T, E>>
    Type Parameters
    Name Description
    T
    E

    Properties

    | Improve this Doc View Source

    Error

    Declaration
    public readonly E Error { get; }
    Property Value
    Type Description
    E
    | 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
    Type Description
    T

    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 Description
    Result<U, E>
    Type Parameters
    Name Description
    U
    | 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 Description
    Result<U, E>
    Type Parameters
    Name Description
    U
    | 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
    Type Description
    Result<T, E>
    | 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 Description
    Result<T, U>
    Type Parameters
    Name Description
    U
    | 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 Description
    Result<U, E>
    Type Parameters
    Name Description
    U
    | Improve this Doc View Source

    Ok(T)

    Declaration
    public static Result<T, E> Ok(T val)
    Parameters
    Type Name Description
    T val
    Returns
    Type Description
    Result<T, E>
    | 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
    Type Description
    Result<T, E>
    | 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
    Type Description
    Result<T, E>

    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
    Type Name Description
    Result<T, E> left
    Result<T, E> right
    Returns
    Type Description
    Result<T, E>
    | 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
    Type Name Description
    Result<T, E> left
    Result<T, E> right
    Returns
    Type Description
    Result<T, E>
    | 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
    Type Name Description
    Result<T, E> left
    Result<T, E> right
    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
    Type Name Description
    Result<T, E> left
    Result<T, E> right
    Returns
    Type Description
    System.Boolean

    Implements

    System.IEquatable<T>

    Extension Methods

    Sugar.Borrow<T>(T)
    Sugar.Owner<T>(T)
    Sugar.AssertEq<T>(T, T)
    Sugar.AssertNe<T>(T, T)
    Sugar.Box<T>(T)
    Sugar.Ref<T>(T)
    Sugar.Let<T, U>(T, Func<T, U>)
    Sugar.LetIf<T>(T, Boolean, Func<T, T>)
    Sugar.Also<T>(T, Action<T>)
    Sugar.AlsoIf<T>(T, Boolean, Action<T>)
    Sugar.MovableBy<T>(T, MovableBy<T>.Drop)
    Sugar.Seq<T>(T)
    Sugar.Seq<T>(T, T[])
    Sugar.Repeat<T>(T, Int32)
    SugarStruct.Swap<T>(ref T, T)
    SugarStruct.Swap<T>(ref T, in T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © LibSugar.
    Generated by DocFX