protocol SingleValueEncodingContainer
Import | import Swift |
---|
Instance Variables
The path of coding keys taken to get to this point in encoding.
Declaration
var codingPath: [CodingKey] { get }
Instance Methods
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
A container that can support the storage and direct encoding of a single non-keyed value.