struct CodingUserInfoKey
Inheritance |
Equatable, Hashable, RawRepresentable
View Protocol Hierarchy →
|
---|---|
Associated Types |
RawValue = String
The raw type that can be used to represent all values of the conforming type. Every distinct value of the conforming type has a corresponding unique
value of the |
Import | import Swift |
Initializers
Creates a new instance with the given raw value.
rawValue
: The value of the key.
Declaration
init?(rawValue: String)
Instance Variables
Conditionally Inherited Items
The initializers, methods, and properties listed below may be available on this type under certain conditions (such as methods that are available on Array
when its elements are Equatable
) or may not ever be available if that determination is beyond SwiftDoc.org's capabilities. Please open an issue on GitHub if you see something out of place!
Where RawValue == Bool
Creates a new instance by decoding from the given decoder, when the
type's RawValue
is Bool
.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
decoder
: The decoder to read data from.
Declaration
init(from decoder: Decoder)
Declared In
RawRepresentable
Encodes this value into the given encoder, when the type's RawValue
is Bool
.
This function throws an error if any values are invalid for the given encoder's format.
encoder
: The encoder to write data to.
Declaration
func encode(to encoder: Encoder) throws
Declared In
RawRepresentable
Where RawValue == Double
Creates a new instance by decoding from the given decoder, when the
type's RawValue
is Double
.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
decoder
: The decoder to read data from.
Declaration
init(from decoder: Decoder)
Declared In
RawRepresentable
Encodes this value into the given encoder, when the type's RawValue
is Double
.
This function throws an error if any values are invalid for the given encoder's format.
encoder
: The encoder to write data to.
Declaration
func encode(to encoder: Encoder) throws
Declared In
RawRepresentable
Where RawValue == Float
Creates a new instance by decoding from the given decoder, when the
type's RawValue
is Float
.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
decoder
: The decoder to read data from.
Declaration
init(from decoder: Decoder)
Declared In
RawRepresentable
Encodes this value into the given encoder, when the type's RawValue
is Float
.
This function throws an error if any values are invalid for the given encoder's format.
encoder
: The encoder to write data to.
Declaration
func encode(to encoder: Encoder) throws
Declared In
RawRepresentable
Where RawValue == Int
Creates a new instance by decoding from the given decoder, when the
type's RawValue
is Int
.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
decoder
: The decoder to read data from.
Declaration
init(from decoder: Decoder)
Declared In
RawRepresentable
Encodes this value into the given encoder, when the type's RawValue
is Int
.
This function throws an error if any values are invalid for the given encoder's format.
encoder
: The encoder to write data to.
Declaration
func encode(to encoder: Encoder) throws
Declared In
RawRepresentable
Where RawValue == Int16
Creates a new instance by decoding from the given decoder, when the
type's RawValue
is Int16
.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
decoder
: The decoder to read data from.
Declaration
init(from decoder: Decoder)
Declared In
RawRepresentable
Encodes this value into the given encoder, when the type's RawValue
is Int16
.
This function throws an error if any values are invalid for the given encoder's format.
encoder
: The encoder to write data to.
Declaration
func encode(to encoder: Encoder) throws
Declared In
RawRepresentable
Where RawValue == Int32
Creates a new instance by decoding from the given decoder, when the
type's RawValue
is Int32
.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
decoder
: The decoder to read data from.
Declaration
init(from decoder: Decoder)
Declared In
RawRepresentable
Encodes this value into the given encoder, when the type's RawValue
is Int32
.
This function throws an error if any values are invalid for the given encoder's format.
encoder
: The encoder to write data to.
Declaration
func encode(to encoder: Encoder) throws
Declared In
RawRepresentable
Where RawValue == Int64
Creates a new instance by decoding from the given decoder, when the
type's RawValue
is Int64
.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
decoder
: The decoder to read data from.
Declaration
init(from decoder: Decoder)
Declared In
RawRepresentable
Encodes this value into the given encoder, when the type's RawValue
is Int64
.
This function throws an error if any values are invalid for the given encoder's format.
encoder
: The encoder to write data to.
Declaration
func encode(to encoder: Encoder) throws
Declared In
RawRepresentable
Where RawValue == Int8
Creates a new instance by decoding from the given decoder, when the
type's RawValue
is Int8
.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
decoder
: The decoder to read data from.
Declaration
init(from decoder: Decoder)
Declared In
RawRepresentable
Encodes this value into the given encoder, when the type's RawValue
is Int8
.
This function throws an error if any values are invalid for the given encoder's format.
encoder
: The encoder to write data to.
Declaration
func encode(to encoder: Encoder) throws
Declared In
RawRepresentable
Where RawValue == String
Creates a new instance by decoding from the given decoder, when the
type's RawValue
is String
.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
decoder
: The decoder to read data from.
Declaration
init(from decoder: Decoder)
Declared In
RawRepresentable
Encodes this value into the given encoder, when the type's RawValue
is String
.
This function throws an error if any values are invalid for the given encoder's format.
encoder
: The encoder to write data to.
Declaration
func encode(to encoder: Encoder) throws
Declared In
RawRepresentable
Where RawValue == UInt
Creates a new instance by decoding from the given decoder, when the
type's RawValue
is UInt
.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
decoder
: The decoder to read data from.
Declaration
init(from decoder: Decoder)
Declared In
RawRepresentable
Encodes this value into the given encoder, when the type's RawValue
is UInt
.
This function throws an error if any values are invalid for the given encoder's format.
encoder
: The encoder to write data to.
Declaration
func encode(to encoder: Encoder) throws
Declared In
RawRepresentable
Where RawValue == UInt16
Creates a new instance by decoding from the given decoder, when the
type's RawValue
is UInt16
.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
decoder
: The decoder to read data from.
Declaration
init(from decoder: Decoder)
Declared In
RawRepresentable
Encodes this value into the given encoder, when the type's RawValue
is UInt16
.
This function throws an error if any values are invalid for the given encoder's format.
encoder
: The encoder to write data to.
Declaration
func encode(to encoder: Encoder) throws
Declared In
RawRepresentable
Where RawValue == UInt32
Creates a new instance by decoding from the given decoder, when the
type's RawValue
is UInt32
.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
decoder
: The decoder to read data from.
Declaration
init(from decoder: Decoder)
Declared In
RawRepresentable
Encodes this value into the given encoder, when the type's RawValue
is UInt32
.
This function throws an error if any values are invalid for the given encoder's format.
encoder
: The encoder to write data to.
Declaration
func encode(to encoder: Encoder) throws
Declared In
RawRepresentable
Where RawValue == UInt64
Creates a new instance by decoding from the given decoder, when the
type's RawValue
is UInt64
.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
decoder
: The decoder to read data from.
Declaration
init(from decoder: Decoder)
Declared In
RawRepresentable
Encodes this value into the given encoder, when the type's RawValue
is UInt64
.
This function throws an error if any values are invalid for the given encoder's format.
encoder
: The encoder to write data to.
Declaration
func encode(to encoder: Encoder) throws
Declared In
RawRepresentable
Where RawValue == UInt8
Creates a new instance by decoding from the given decoder, when the
type's RawValue
is UInt8
.
This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.
decoder
: The decoder to read data from.
Declaration
init(from decoder: Decoder)
Declared In
RawRepresentable
Encodes this value into the given encoder, when the type's RawValue
is UInt8
.
This function throws an error if any values are invalid for the given encoder's format.
encoder
: The encoder to write data to.
Declaration
func encode(to encoder: Encoder) throws
Declared In
RawRepresentable
A user-defined key for providing context during encoding and decoding.