Back to Alamofire

DownloadTask

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

5.12.01.3 KB
Original Source

DownloadTask

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public struct DownloadTask<Value> : Sendable where Value : Sendable

Value used to await a DownloadResponse and associated values.

`

                response
                ` Asynchronous 

DownloadResponse produced by the DownloadRequest and its response handler.

Declaration

Swift

public var response: DownloadResponse<Value, AFError> { get async }

`

                result
                ` Asynchronous 

Result of any response serialization performed for the response.

Declaration

Swift

public var result: Result<Value, AFError> { get async }

`

                value
                ` Asynchronous 

Value returned by the response.

Declaration

Swift

public var value: Value { get async throws }

`

                cancel()
                `

Cancel the underlying DownloadRequest and Task.

Declaration

Swift

public func cancel()

`

                resume()
                `

Resume the underlying DownloadRequest.

Declaration

Swift

public func resume()

`

                suspend()
                `

Suspend the underlying DownloadRequest.

Declaration

Swift

public func suspend()