MetaKeyedDecodingContainer

open class MetaKeyedDecodingContainer<K> : KeyedDecodingContainerProtocol where K : CodingKey

Manages a DecodingKeyedContainerMeta

  • Key

    Declaration

    Swift

    public typealias Key = K
  • This MetaKeyedDecodingContainer’s meta.

    Declaration

    Swift

    public let meta: DecodingKeyedContainerMeta
  • The decoder that created this container.

    Decoding, creating new containers and creating super decoders is delegated to it.

    Declaration

    Swift

    public let decoder: MetaDecoder
  • Declaration

    Swift

    public let codingPath: [CodingKey]

initalization

container methods

  • Declaration

    Swift

    public var allKeys: [Key] { get }
  • Declaration

    Swift

    public func contains(_ key: Key) -> Bool

decoding

  • Declaration

    Swift

    public func decodeNil(forKey key: Key) throws -> Bool
  • Declaration

    Swift

    public func decode<T>(_ type: T.Type, forKey key: Key) throws -> T where T : Decodable

nested containers

  • Declaration

    Swift

    open func nestedContainer<NestedKey>(keyedBy keyType: NestedKey.Type, forKey key: K) throws -> KeyedDecodingContainer<NestedKey> where NestedKey : CodingKey
  • Declaration

    Swift

    open func nestedUnkeyedContainer(forKey key: K) throws -> UnkeyedDecodingContainer

super decoder

utilities

  • An utility mathod that acesses the meta stored at key and throws an error, if the value isn’t present.

    Declaration

    Swift

    public func accessMeta(at key: CodingKey) throws -> Meta