DownloadResponseSerializer

public struct DownloadResponseSerializer<Value> : DownloadResponseSerializerProtocol

A generic DownloadResponseSerializerType used to serialize a request, response, and data into a serialized object.

  • The type of serialized object to be created by this DownloadResponseSerializer.

    Declaration

    Swift

    public typealias SerializedObject = Value
  • A closure used by response handlers that takes a request, response, url and error and returns a result.

    Declaration

    Swift

    public var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result<Value>
  • Initializes the ResponseSerializer instance with the given serialize response closure.

    Declaration

    Swift

    public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result<Value>)

    Parameters

    serializeResponse

    The closure used to serialize the response.

    Return Value

    The new generic response serializer instance.