Required Instance Methodswift 6.0.1Swift
encode(_:)
Encodes the given value.
mutating func encode(_ value: String) throws
Parameters
- value
The value to encode.
Throws
EncodingError.invalidValue
if the given value is invalid in the current context for this format.
Other requirements
View members
Hide members
This section is hidden by default because it contains too many (40) members.
Instance members
var codingPath: [any CodingKey]
The path of coding keys taken to get to this point in encoding.
var count: Int
The number of elements encoded into the container.
func encode(Bool
) throws Encodes the given value.
func encode(Double
) throws Encodes the given value.
func encode(Float
) throws Encodes the given value.
func encode(Int
) throws Encodes the given value.
func encode(UInt
) throws Encodes the given value.
func encode<T>(T
) throws Encodes the given value.
func encode(Int8
) throws Encodes the given value.
func encode(Int16
) throws Encodes the given value.
func encode(Int32
) throws Encodes the given value.
func encode(Int64
) throws Encodes the given value.
func encode(UInt8
) throws Encodes the given value.
func encode(Int128
) throws Encodes the given value.
func encode(UInt16
) throws Encodes the given value.
func encode(UInt32
) throws Encodes the given value.
func encode(UInt64
) throws Encodes the given value.
func encode(UInt128
) throws Encodes the given value.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encode<T>(contentsOf: T
) throws Encodes the elements of the given sequence.
func encodeConditional<T>(T
) throws Encodes a reference to the given object only if it is encoded unconditionally elsewhere in the payload (previously, or in the future).
func encodeNil(
) throws Encodes a null value.
func nestedContainer<NestedKey>(keyedBy: NestedKey.Type
) -> KeyedEncodingContainer<NestedKey> Encodes a nested container keyed by the given type and returns it.
func nestedUnkeyedContainer(
) -> any UnkeyedEncodingContainer Encodes an unkeyed encoding container and returns it.
func superEncoder(
) -> any Encoder Encodes a nested container and returns an
Encoder
instance for encodingsuper
into that container.