Required Instance Methodswift 6.0.1Swift
decode(_:)
Decodes a single value of the given type.
func decode(_ type: UInt.Type) throws -> UInt
Parameters
- type
The type to decode as.
Returns
A value of the requested type.
Throws
DecodingError.typeMismatch
if the encountered encoded value cannot be converted to the requested type.
DecodingError.valueNotFound
if the encountered encoded value is null.
Other requirements
View members
Hide members
This section is hidden by default because it contains too many (18) members.
Instance members
var codingPath: [any CodingKey]
The path of coding keys taken to get to this point in encoding.
func decode(String.Type
) throws -> String Decodes a single value of the given type.
func decode(Bool.Type
) throws -> Bool Decodes a single value of the given type.
func decode(Double.Type
) throws -> Double Decodes a single value of the given type.
func decode(Float.Type
) throws -> Float Decodes a single value of the given type.
func decode(Int.Type
) throws -> Int Decodes a single value of the given type.
func decode<T>(T.Type
) throws -> T Decodes a single value of the given type.
func decode(Int8.Type
) throws -> Int8 Decodes a single value of the given type.
func decode(Int16.Type
) throws -> Int16 Decodes a single value of the given type.
func decode(Int32.Type
) throws -> Int32 Decodes a single value of the given type.
func decode(Int64.Type
) throws -> Int64 Decodes a single value of the given type.
func decode(UInt8.Type
) throws -> UInt8 Decodes a single value of the given type.
func decode(Int128.Type
) throws -> Int128 Decodes a single value of the given type.
func decode(UInt16.Type
) throws -> UInt16 Decodes a single value of the given type.
func decode(UInt32.Type
) throws -> UInt32 Decodes a single value of the given type.
func decode(UInt64.Type
) throws -> UInt64 Decodes a single value of the given type.
func decode(UInt128.Type
) throws -> UInt128 Decodes a single value of the given type.
func decodeNil(
) -> Bool Decodes a null value.