SingleValueEncodingContainer

protocol SingleValueEncodingContainer

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

Instance Variables

var codingPath Required

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

Declaration

var codingPath: [CodingKey]

Instance Methods

func encode(_ value: Bool) throws Required

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a single value of the given type.

  • parameter value: The value to encode.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

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

Encodes a null value.

Precondition: May not be called after a previous self.encode(_:) call.

Declaration

mutating func encodeNil() throws