Back to Alamofire

DataDecoder

docs/Protocols/DataDecoder.html

5.12.0671 B
Original Source

DataDecoder

public protocol DataDecoder : Sendable

Any type which can decode Data into a Decodable type.

`

                decode(_:from:)
                `

Decode Data into the provided type.

Throws

Any error that occurs during decode.

Declaration

Swift

func decode<D>(_ type: D.Type, from data: Data) throws -> D where D : Decodable

Parameters

| type |

The Type to be decoded.

| | data |

The Data to be decoded.

|

Return Value

The decoded value of type D.