SingleValueEncodingContainer

protocol SingleValueEncodingContainer

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

Import import Swift

Instance Variables

var codingPath: [CodingKey] Required

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

Declaration

var codingPath: [CodingKey] { get }

Instance Methods

mutating func encode(_: Bool) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode(_ value: Bool) throws
mutating func encode(_: Double) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode(_ value: Double) throws
mutating func encode(_: Float) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode(_ value: Float) throws
mutating func encode(_: Int) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode(_ value: Int) throws
mutating func encode(_: Int8) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode(_ value: Int8) throws
mutating func encode(_: Int16) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode(_ value: Int16) throws
mutating func encode(_: Int32) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode(_ value: Int32) throws
mutating func encode(_: Int64) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode(_ value: Int64) throws
mutating func encode(_: String) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode(_ value: String) throws
mutating func encode(_: UInt) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode(_ value: UInt) throws
mutating func encode(_: UInt8) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode(_ value: UInt8) throws
mutating func encode(_: UInt16) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode(_ value: UInt16) throws
mutating func encode(_: UInt32) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode(_ value: UInt32) throws
mutating func encode(_: UInt64) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode(_ value: UInt64) throws
mutating func encode<T>(_: T) Required

Encodes a single value of the given type.

value: The value to encode. throws: EncodingError.invalidValue if the given value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encode<T>(_ value: T) throws
mutating func encodeNil() Required

Encodes a null value.

throws: EncodingError.invalidValue if a null value is invalid in the current context for this format. precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encodeNil() throws