Protocol

UnkeyedEncodingContainer

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.

Declaration

protocol UnkeyedEncodingContainer

Overview

Encoders should provide types conforming to UnkeyedEncodingContainer for their format.

Topics

Instance Properties

var codingPath: [CodingKey]

The path of coding keys taken to get to this point in encoding.

Required.

var count: Int

The number of elements encoded into the container.

Required.

Instance Methods

func encode(Int32)

Encodes the given value.

Required.

func encode(String)

Encodes the given value.

Required.

func encode(UInt64)

Encodes the given value.

Required.

func encode(UInt)

Encodes the given value.

Required.

func encode(Float)

Encodes the given value.

Required.

func encode(UInt8)

Encodes the given value.

Required.

func encode<T>(T)

Encodes the given value.

Required.

func encode(Bool)

Encodes the given value.

Required.

func encode(Int64)

Encodes the given value.

Required.

func encode(UInt16)

Encodes the given value.

Required.

func encode(Double)

Encodes the given value.

Required.

func encode(Int)

Encodes the given value.

Required.

func encode(Int16)

Encodes the given value.

Required.

func encode(UInt32)

Encodes the given value.

Required.

func encode(Int8)

Encodes the given value.

Required.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required. Default implementations provided.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required.

func encode<T>(contentsOf: T)

Encodes the elements of the given sequence.

Required.

func encodeConditional<T>(T)

Encodes a reference to the given object only if it is encoded unconditionally elsewhere in the payload (previously, or in the future).

Required. Default implementation provided.

func encodeNil()

Encodes a null value.

Required.

func nestedContainer<NestedKey>(keyedBy: NestedKey.Type) -> KeyedEncodingContainer<NestedKey>

Encodes a nested container keyed by the given type and returns it.

Required.

func nestedUnkeyedContainer() -> UnkeyedEncodingContainer

Encodes an unkeyed encoding container and returns it.

Required.

func superEncoder() -> Encoder

Encodes a nested container and returns an Encoder instance for encoding super into that container.

Required.

See Also

Encoding Containers

protocol SingleValueEncodingContainer

A container that can support the storage and direct encoding of a single non-keyed value.

struct KeyedEncodingContainer

A concrete container that provides a view into an encoder’s storage, making the encoded properties of an encodable type accessible by keys.

protocol KeyedEncodingContainerProtocol

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.