Instance Methodswift 6.0.3Swift
decode(_:forKey:)
func decode(_ type: Bool.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Bool
func decode(_ type: Bool.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Bool
import Swift
struct KeyedDecodingContainer<K> where K : CodingKey
A concrete container that provides a view into a decoder’s storage, making the encoded properties of a decodable type accessible by keys.
@frozen struct Bool
A value type whose instances are either true
or false
.
init<Container>(_ container: Container) where K == Container.Key, Container : KeyedDecodingContainerProtocol
Creates a new instance with the given container.
var allKeys: [KeyedDecodingContainer<K>.Key] { get }
All the keys the decoder has for this container.
var codingPath: [any CodingKey] { get }
func contains(_ key: KeyedDecodingContainer<K>.Key) -> Bool
Returns a Boolean value indicating whether the decoder contains a value associated with the given key.
func decode(_ type: String.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> String
func decode(_ type: Double.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Double
func decode(_ type: Float.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Float
func decode(_ type: Int.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Int
func decode(_ type: UInt.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> UInt
func decode<T>(_ type: T.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> T where T : Decodable
func decode(_ type: Int8.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Int8
func decode(_ type: Int16.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Int16
func decode(_ type: Int32.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Int32
func decode(_ type: Int64.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Int64
func decode(_ type: UInt8.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> UInt8
func decode(_ type: Int128.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Int128
func decode(_ type: UInt16.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> UInt16
func decode(_ type: UInt32.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> UInt32
func decode(_ type: UInt64.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> UInt64
func decode(_ type: UInt128.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> UInt128
func decodeIfPresent(_ type: String.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> String?
func decodeIfPresent(_ type: Bool.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Bool?
func decodeIfPresent(_ type: Double.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Double?
func decodeIfPresent(_ type: Float.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Float?
func decodeIfPresent(_ type: Int.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Int?
func decodeIfPresent(_ type: UInt.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> UInt?
func decodeIfPresent<T>(_ type: T.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> T? where T : Decodable
func decodeIfPresent(_ type: Int8.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Int8?
func decodeIfPresent(_ type: Int16.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Int16?
func decodeIfPresent(_ type: Int32.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Int32?
func decodeIfPresent(_ type: Int64.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Int64?
func decodeIfPresent(_ type: UInt8.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> UInt8?
func decodeIfPresent(_ type: Int128.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> Int128?
func decodeIfPresent(_ type: UInt16.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> UInt16?
func decodeIfPresent(_ type: UInt32.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> UInt32?
func decodeIfPresent(_ type: UInt64.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> UInt64?
func decodeIfPresent(_ type: UInt128.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> UInt128?
func decodeNil(forKey key: KeyedDecodingContainer<K>.Key) throws -> Bool
func nestedContainer<NestedKey>(keyedBy type: NestedKey.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> KeyedDecodingContainer<NestedKey> where NestedKey : CodingKey
func nestedUnkeyedContainer(forKey key: KeyedDecodingContainer<K>.Key) throws -> any UnkeyedDecodingContainer
func superDecoder() throws -> any Decoder
Returns a Decoder
instance for decoding super
from the container associated with the default super
key.
func superDecoder(forKey key: KeyedDecodingContainer<K>.Key) throws -> any Decoder
typealias Key = K