A concrete container that provides a view into an encoder’s storage, making the encoded properties of an encodable type accessible by keys.
SDK
- Xcode 9.0+
Framework
- Swift Standard Library
A concrete container that provides a view into an encoder’s storage, making the encoded properties of an encodable type accessible by keys.
SDK
Framework
init<Container>(Container)
Creates a new instance with the given container.
var coding Path: [Coding Key]
The path of coding keys taken to get to this point in encoding.
func encode(UInt64, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode<T>(T, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode(UInt32, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode(String, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode(Int16, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode(Double, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode(Int64, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode(Int8, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode(Int, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode(Float, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode(UInt8, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode(Bool, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode(UInt, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode(UInt16, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode(Int32, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key.
func encode Conditional<T>(T, for Key: Keyed Encoding Container<K>.Key)
Encodes a reference to the given object only if it is encoded unconditionally elsewhere in the payload (previously, or in the future).
func encode Conditional<T>(T, for Key: K)
Encodes a reference to the given object only if it is encoded unconditionally elsewhere in the payload (previously, or in the future).
func encode If Present(UInt8?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode If Present(Double?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode If Present(UInt32?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode If Present(Float?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode If Present(Int8?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode If Present<T>(T?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode If Present(UInt?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode If Present(Int32?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode If Present(Int16?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode If Present(UInt16?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode If Present(Int64?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode If Present(Bool?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode If Present(UInt64?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode If Present(String?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode If Present(Int?, for Key: Keyed Encoding Container<K>.Key)
Encodes the given value for the given key if it is not nil
.
func encode Nil(for Key: Keyed Encoding Container<K>.Key)
Encodes a null value for the given key.
func nested Container<Nested Key>(keyed By: Nested Key .Type, for Key: Keyed Encoding Container<K>.Key) -> Keyed Encoding Container<Nested Key>
Stores a keyed encoding container for the given key and returns it.
func nested Unkeyed Container(for Key: Keyed Encoding Container<K>.Key) -> Unkeyed Encoding Container
Stores an unkeyed encoding container for the given key and returns it.
func super Encoder() -> Encoder
Stores a new nested container for the default super
key and returns A new encoder instance for encoding super
into that container.
func super Encoder(for Key: Keyed Encoding Container<K>.Key) -> Encoder
Stores a new nested container for the given key and returns A new encoder instance for encoding super
into that container.
protocol Single Value Encoding Container
A container that can support the storage and direct encoding of a single non-keyed value.
protocol Keyed Encoding Container Protocol
A type that provides a view into an encoder’s storage and is used to hold the encoded properties of an encodable type in a keyed manner.
protocol Unkeyed Encoding Container
A type that provides a view into an encoder’s storage and is used to hold the encoded properties of an encodable type sequentially, without keys.