DataDecoder
public protocol DataDecoder : Sendable
Any type which can decode Data
into a Decodable
type.
-
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
.