encode(_:)
Encodes a single value of the given type.
mutating func encode(_ value: UInt32) throws
Parameters
- value
The value to encode.
Throws
EncodingError.invalidValue
if the given value is invalid in the current context for this format.
Encodes a single value of the given type.
mutating func encode(_ value: UInt32) throws
The value to encode.
EncodingError.invalidValue
if the given value is invalid in the current context for this format.
import Swift
protocol SingleValueEncodingContainer
A container that can support the storage and direct encoding of a single non-keyed value.
@frozen struct UInt32
A 32-bit unsigned integer value type.
var codingPath: [any CodingKey] { get }
The path of coding keys taken to get to this point in encoding.
mutating func encode(_ value: String) throws
Encodes a single value of the given type.
mutating func encode(_ value: Bool) throws
Encodes a single value of the given type.
mutating func encode(_ value: Double) throws
Encodes a single value of the given type.
mutating func encode(_ value: Float) throws
Encodes a single value of the given type.
mutating func encode(_ value: Int) throws
Encodes a single value of the given type.
mutating func encode(_ value: UInt) throws
Encodes a single value of the given type.
mutating func encode<T>(_ value: T) throws where T : Encodable
Encodes a single value of the given type.
mutating func encode(_ value: Int8) throws
Encodes a single value of the given type.
mutating func encode(_ value: Int16) throws
Encodes a single value of the given type.
mutating func encode(_ value: Int32) throws
Encodes a single value of the given type.
mutating func encode(_ value: Int64) throws
Encodes a single value of the given type.
mutating func encode(_ value: UInt8) throws
Encodes a single value of the given type.
mutating func encode(_ value: Int128) throws
Encodes a single value of the given type.
mutating func encode(_ value: UInt16) throws
Encodes a single value of the given type.
mutating func encode(_ value: UInt64) throws
Encodes a single value of the given type.
mutating func encode(_ value: UInt128) throws
Encodes a single value of the given type.
mutating func encodeNil() throws
Encodes a null value.
mutating func encode(_ value: Int128) throws
mutating func encode(_ value: UInt128) throws
mutating func encode(_ value: Int128) throws
mutating func encode(_ value: UInt128) throws