Back to Alamofire

Stream

docs/docsets/Alamofire.docset/Contents/Resources/Documents/Classes/DataStreamRequest/Stream.html

5.12.01.5 KB
Original Source

Stream

public struct Stream<Success, Failure> : Sendable where Success : Sendable, 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.

`

                event
                `

Latest Event from the stream.

Declaration

Swift

public let event: Event<Success, Failure>

`

                token
                `

Token used to cancel the stream.

Declaration

Swift

public let token: CancellationToken

`

                cancel()
                `

Cancel the ongoing stream by canceling the underlying DataStreamRequest.

Declaration

Swift

public func cancel()

`

                result
                `

Incoming Result values from Event.stream.

Declaration

Swift

public var result: Result<Success, Failure>? { get }

`

                value
                `

Success value of the instance, if any.

Declaration

Swift

public var value: Success? { get }

`

                error
                `

Failure value of the instance, if any.

Declaration

Swift

public var error: Failure? { get }

`

                completion
                `

Completion value of the instance, if any.

Declaration

Swift

public var completion: DataStreamRequest.Completion? { get }