docs/Structs/DownloadResponsePublisher.html
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)
public struct DownloadResponsePublisher<Value> : Publisher where Value : Sendable
A Combine Publisher that publishes the DownloadResponse<Value, AFError> of the provided DownloadRequest.
`
Output
`
Swift
public typealias Output = DownloadResponse<Value, AFError>
`
Failure
`
Swift
public typealias Failure = Never
`
init(_:queue:serializer:)
`
Creates an instance which will serialize responses using the provided ResponseSerializer.
Swift
public init<Serializer: ResponseSerializer>(_ request: DownloadRequest, queue: DispatchQueue, serializer: Serializer)
where Value == Serializer.SerializedObject
| request |
DownloadRequest for which to publish the response.
|
| queue |
DispatchQueue on which the DownloadResponse value will be published. .main by default.
|
| serializer |
ResponseSerializer used to produce the published DownloadResponse.
|
`
init(_:queue:serializer:)
`
Creates an instance which will serialize responses using the provided DownloadResponseSerializerProtocol value.
Swift
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)
public init<Serializer: DownloadResponseSerializerProtocol>(_ request: DownloadRequest,
queue: DispatchQueue,
serializer: Serializer)
where Value == Serializer.SerializedObject
| request |
DownloadRequest for which to publish the response.
|
| queue |
DispatchQueue on which the DataResponse value will be published. .main by default.
|
| serializer |
DownloadResponseSerializerProtocol used to produce the published DownloadResponse.
|
`
result()
`
Publishes only the Result of the DownloadResponse value.
Swift
public func result() -> AnyPublisher<Result<Value, AFError>, Never>
The AnyPublisher publishing the Result<Value, AFError> value.
`
value()
`
Publishes the Result of the DownloadResponse as a single Value or fail with the AFError instance.
Swift
public func value() -> AnyPublisher<Value, AFError>
The AnyPublisher<Value, AFError> publishing the stream.
`
receive(subscriber:)
`
Swift
public func receive<S>(subscriber: S) where S : Subscriber, S : Sendable, S.Failure == Never, S.Input == DownloadResponse<Value, AFError>
Value == URL?`
init(_:queue:)
`
Creates an instance which publishes a DownloadResponse<URL?, AFError> value without serialization.
Swift
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)
public init(_ request: DownloadRequest, queue: DispatchQueue)