A type that can decode values from a native format into in-memory representations.
SDK
- Xcode 9.0+
Framework
- Swift Standard Library
Declaration
protocol Decoder
A type that can decode values from a native format into in-memory representations.
SDK
Framework
protocol Decoder
var coding Path: [Coding Key]The path of coding keys taken to get to this point in decoding.
Required.
var user Info: [Coding User Info Key : Any]Any contextual information set by the user for decoding.
Required.
func container<Key>(keyed By: Key .Type) -> Keyed Decoding Container<Key>Returns the data stored in this decoder as represented in a container keyed by the given key type.
Required.
func single Value Container() -> Single Value Decoding ContainerReturns the data stored in this decoder as represented in a container appropriate for holding a single primitive value.
Required.
func unkeyed Container() -> Unkeyed Decoding ContainerReturns the data stored in this decoder as represented in a container appropriate for holding values with no keys.
Required.
protocol EncoderA type that can encode values into a native format for external representation.
enum Encoding ErrorAn error that occurs during the encoding of a value.
enum Decoding ErrorAn error that occurs during the decoding of a value.