Stream

public struct Stream<Success, Failure> where Failure : Error

Type encapsulating an Event as it flows through the stream, as well as a CancellationToken which can be used to stop the stream at any time.

  • Latest Event from the stream.

    Declaration

    Swift

    public let event: Event<Success, Failure>
  • Token used to cancel the stream.

    Declaration

    Swift

    public let token: CancellationToken
  • Cancel the ongoing stream by canceling the underlying DataStreamRequest.

    Declaration

    Swift

    public func cancel()
  • Incoming Result values from Event.stream.

    Declaration

    Swift

    public var result: Result<Success, Failure>? { get }
  • Success value of the instance, if any.

    Declaration

    Swift

    public var value: Success? { get }
  • Failure value of the instance, if any.

    Declaration

    Swift

    public var error: Failure? { get }
  • Completion value of the instance, if any.

    Declaration

    Swift

    public var completion: DataStreamRequest.Completion? { get }