Back to Alamofire

DataStreamPublisher

docs/docsets/Alamofire.docset/Contents/Resources/Documents/Structs/DataStreamPublisher.html

5.12.02.2 KB
Original Source

DataStreamPublisher

public struct DataStreamPublisher<Value> : Publisher where Value : Sendable

Undocumented

`

                Output
                `

Declaration

Swift

public typealias Output = DataStreamRequest.Stream<Value, AFError>

`

                Failure
                `

Declaration

Swift

public typealias Failure = Never

`

                init(_:queue:serializer:)
                `

Creates an instance which will serialize responses using the provided DataStreamSerializer.

Declaration

Swift

public init<Serializer: DataStreamSerializer>(_ request: DataStreamRequest, queue: DispatchQueue, serializer: Serializer)
    where Value == Serializer.SerializedObject

Parameters

| request |

DataStreamRequest for which to publish the response.

| | queue |

DispatchQueue on which the Stream<Value, AFError> values will be published. .main by default.

| | serializer |

DataStreamSerializer used to produce the published Stream<Value, AFError> values.

|

`

                result()
                `

Publishes only the Result of the DataStreamRequest.Stream‘s Events.

Declaration

Swift

public func result() -> AnyPublisher<Result<Value, AFError>, Never>

Return Value

The AnyPublisher publishing the Result<Value, AFError> value.

`

                value()
                `

Publishes the streamed values of the DataStreamRequest.Stream as a sequence of Value or fail with the AFError instance.

Declaration

Swift

public func value() -> AnyPublisher<Value, AFError>

Return Value

The AnyPublisher<Value, AFError> publishing the stream.

`

                receive(subscriber:)
                `

Declaration

Swift

public func receive<S>(subscriber: S) where S : Subscriber, S : Sendable, S.Failure == Never, S.Input == DataStreamRequest.Stream<Value, AFError>