DownloadResponsePublisher
@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.
-
Declaration
Swift
public typealias Output = DownloadResponse<Value, AFError> -
Declaration
Swift
public typealias Failure = Never -
Creates an instance which will serialize responses using the provided
ResponseSerializer.Declaration
Swift
public init<Serializer: ResponseSerializer>(_ request: DownloadRequest, queue: DispatchQueue, serializer: Serializer) where Value == Serializer.SerializedObjectParameters
requestDownloadRequestfor which to publish the response.queueDispatchQueueon which theDownloadResponsevalue will be published..mainby default.serializerResponseSerializerused to produce the publishedDownloadResponse. -
Creates an instance which will serialize responses using the provided
DownloadResponseSerializerProtocolvalue.Declaration
Swift
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *) public init<Serializer: DownloadResponseSerializerProtocol>(_ request: DownloadRequest, queue: DispatchQueue, serializer: Serializer) where Value == Serializer.SerializedObjectParameters
requestDownloadRequestfor which to publish the response.queueDispatchQueueon which theDataResponsevalue will be published..mainby default.serializerDownloadResponseSerializerProtocolused to produce the publishedDownloadResponse. -
Publishes only the
Resultof theDownloadResponsevalue.Declaration
Swift
public func result() -> AnyPublisher<Result<Value, AFError>, Never>Return Value
The
AnyPublisherpublishing theResult<Value, AFError>value. -
Publishes the
Resultof theDownloadResponseas a singleValueor fail with theAFErrorinstance.Declaration
Swift
public func value() -> AnyPublisher<Value, AFError>Return Value
The
AnyPublisher<Value, AFError>publishing the stream. -
Declaration
Swift
public func receive<S>(subscriber: S) where S : Subscriber, S : Sendable, S.Failure == Never, S.Input == DownloadResponse<Value, AFError>
-
Creates an instance which publishes a
DownloadResponse<URL?, AFError>value without serialization.Declaration
Swift
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *) public init(_ request: DownloadRequest, queue: DispatchQueue)
View on GitHub
Install in Dash