Event

public enum Event<Success, Failure> : Sendable where Success : Sendable, Failure : Error

Type representing an event flowing through the stream. Contains either the Result of processing streamed Data or the completion of the stream.

  • Output produced every time the instance receives additional Data. The associated value contains the Result of processing the incoming Data.

    Declaration

    Swift

    case stream(Result<Success, Failure>)
  • Output produced when the instance has completed, whether due to stream end, cancellation, or an error. Associated Completion value contains the final state.

    Declaration

    Swift

    case complete(Completion)