Search Results for

    Show / Hide Table of Contents

    Struct Result

    Implements
    IResult
    Inherited Members
    System.ValueType.Equals(System.Object)
    System.ValueType.GetHashCode()
    System.ValueType.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Color_Chan.Discord.Core.Results
    Assembly: Color-Chan.Discord.Core.dll
    Syntax
    public readonly struct Result : IResult

    Properties

    | Improve this Doc View Source

    ErrorResult

    The error of the IResult.

    Declaration
    public readonly IErrorResult ErrorResult { get; }
    Property Value
    Type Description
    IErrorResult
    Remarks

    Null if the result doesn't have an inner result.

    | Improve this Doc View Source

    InnerResult

    The inner IResult.

    Declaration
    public readonly IResult InnerResult { get; }
    Property Value
    Type Description
    IResult
    Remarks

    Null if the IResult doesn't have an inner IResult.

    | Improve this Doc View Source

    IsSuccessful

    Whether or not the IResult is successful.

    Declaration
    public readonly bool IsSuccessful { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    FromError(IErrorResult)

    Initializes a new unsuccessful instance of Result.

    Declaration
    public static Result FromError(IErrorResult errorResult)
    Parameters
    Type Name Description
    IErrorResult errorResult

    The IErrorResult containing the error details.

    Returns
    Type Description
    Result

    The unsuccessful instance of Result.

    | Improve this Doc View Source

    FromError(IErrorResult, IResult)

    Initializes a new unsuccessful instance of Result.

    Declaration
    public static Result FromError(IErrorResult errorResult, IResult innerResult)
    Parameters
    Type Name Description
    IErrorResult errorResult

    The IErrorResult containing the error details.

    IResult innerResult

    The inner IResult.

    Returns
    Type Description
    Result

    The unsuccessful instance of Result.

    | Improve this Doc View Source

    FromSuccess()

    Initializes a new successful instance of Result.

    Declaration
    public static Result FromSuccess()
    Returns
    Type Description
    Result

    The successful instance of Result.

    Operators

    | Improve this Doc View Source

    Implicit(ErrorResult to Result)

    Creates a Result from an ErrorResult.

    Declaration
    public static implicit operator Result(ErrorResult error)
    Parameters
    Type Name Description
    ErrorResult error

    The ErrorResult.

    Returns
    Type Description
    Result

    The unsuccessful instance of Result.

    | Improve this Doc View Source

    Implicit(Exception to Result)

    Creates a Result with an System.Exception.

    Declaration
    public static implicit operator Result(Exception exception)
    Parameters
    Type Name Description
    System.Exception exception

    The System.Exception.

    Returns
    Type Description
    Result

    The unsuccessful instance of Result.

    Implements

    IResult
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX