Event

public enum Event<Element>

Represents a sequence event.

Sequence grammar: next* (error | completed)

  • Next element is produced.

    Declaration

    Swift

    case next(Element)
  • Sequence terminated with an error.

    Declaration

    Swift

    case error(Error)
  • Sequence completed successfully.

    Declaration

    Swift

    case completed
  • Description of event.

    Declaration

    Swift

    public var debugDescription: String { get }
  • Is completed or error event.

    Declaration

    Swift

    public var isStopEvent: Bool { get }
  • If next event, returns element value.

    Declaration

    Swift

    public var element: Element? { get }
  • If error event, returns error.

    Declaration

    Swift

    public var error: Swift.Error? { get }
  • If completed event, returns true.

    Declaration

    Swift

    public var isCompleted: Bool { get }
  • Maps sequence elements using transform. If error happens during the transform, .error will be returned as value.

    Declaration

    Swift

    public func map<Result>(_ transform: (Element) throws -> Result) -> Event<Result>
  • Event representation of this instance

    Declaration

    Swift

    public var event: Event<Element> { get }