protocol
UnkeyedEncodingContainer
Import |
|
---|
Instance Variables
The path of coding keys taken to get to this point in encoding.
Declaration
var
codingPath
: [
CodingKey
] {
get
}
Instance Methods
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
(
_
value
:
Bool
)
throws
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
(
_
value
:
Double
)
throws
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
(
_
value
:
Float
)
throws
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
(
_
value
:
Int
)
throws
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
(
_
value
:
Int8
)
throws
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
(
_
value
:
Int16
)
throws
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
(
_
value
:
Int32
)
throws
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
(
_
value
:
Int64
)
throws
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
(
_
value
:
String
)
throws
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
(
_
value
:
UInt
)
throws
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
(
_
value
:
UInt8
)
throws
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
(
_
value
:
UInt16
)
throws
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
(
_
value
:
UInt32
)
throws
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
(
_
value
:
UInt64
)
throws
Encodes the given value.
value
: The value to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encode
<
T
>
(
_
value
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes the elements of the given sequence.
sequence
: The sequences whose contents to encode.
throws: An error if any of the contained values throws an error.
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Encodes a reference to the given object only if it is encoded unconditionally elsewhere in the payload (previously, or in the future).
For encoders which don't support this feature, the default implementation encodes the given object unconditionally.
For formats which don't support this feature, the default implementation encodes the given object unconditionally.
object
: The object to encode.
throws: EncodingError.invalidValue
if the given value is invalid in
the current context for this format.
Declaration
mutating
func
encodeConditional
<
T
>
(
_
object
:
T
)
throws
Encodes a null value.
throws: EncodingError.invalidValue
if a null value is invalid in the
current context for this format.
Declaration
mutating
func
encodeNil
()
throws
Encodes a nested container keyed by the given type and returns it.
keyType
: The key type to use for the container.
returns: A new keyed encoding container.
Declaration
mutating
func
nestedContainer
<
NestedKey
>
(
keyedBy
keyType
:
NestedKey
.
Type
) -
>
KeyedEncodingContainer
<
NestedKey
>
where
NestedKey
:
CodingKey
Encodes an unkeyed encoding container and returns it.
returns: A new unkeyed encoding container.
Declaration
mutating
func
nestedUnkeyedContainer
() -
>
UnkeyedEncodingContainer
Encodes a nested container and returns an Encoder
instance for encoding
super
into that container.
returns: A new encoder to pass to super.encode(to:)
.
Declaration
mutating
func
superEncoder
() -
>
Encoder
Default Implementations
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encode
<
T
>
(
contentsOf
sequence
:
T
)
throws
Declaration
mutating
func
encodeConditional
<
T
>
(
_
object
:
T
)
throws
A type that provides a view into an encoder's storage and is used to hold the encoded properties of an encodable type sequentially, without keys.
Encoders should provide types conforming to
UnkeyedEncodingContainer
for their format.