Result

public enum Result<T,E>

Container for a successful value (T) or a failure with an E

  • Undocumented

    Declaration

    Swift

    public enum Result<T,E>
  • Undocumented

    Declaration

    Swift

    public enum Result<T,E>
  • The successful value as an Optional

    Declaration

    Swift

    public var value: T?
  • The failing error as an Optional

    Declaration

    Swift

    public var error: E?
  • Undocumented

    Declaration

    Swift

    public enum Result<T,E>
  • Return a new result after applying a transformation to a successful value. Mapping a failure returns a new failure without evaluating the transform

    Declaration

    Swift

    public func map<U>(transform: T -> U) -> Result<U,E>
  • Return a new result after applying a transformation (that itself returns a result) to a successful value. Calling with a failure returns a new failure without evaluating the transform

    Declaration

    Swift

    public func flatMap<U>(transform:T -> Result<U,E>) -> Result<U,E>
  • Undocumented

    Declaration

    Swift

    public enum Result<T,E>