Instance Method

encode(to:)

Encodes this value into the given encoder, when the type’s RawValue is Int8.

Declaration

func encode(to encoder: Encoder) throws
Available when Self conforms to Encodable and RawValue is Int8.

Parameters

encoder

The encoder to write data to.

Discussion

This function throws an error if any values are invalid for the given encoder’s format.

See Also

Encoding a Value

func encode(to: Encoder)

Encodes this value into the given encoder, when the type’s RawValue is String.

func encode(to: Encoder)

Encodes this value into the given encoder, when the type’s RawValue is Bool.

func encode(to: Encoder)

Encodes this value into the given encoder, when the type’s RawValue is Double.

func encode(to: Encoder)

Encodes this value into the given encoder, when the type’s RawValue is Float.

func encode(to: Encoder)

Encodes this value into the given encoder, when the type’s RawValue is Int.

func encode(to: Encoder)

Encodes this value into the given encoder, when the type’s RawValue is UInt.

func encode(to: Encoder)

Encodes this value into the given encoder, when the type’s RawValue is Int16.

func encode(to: Encoder)

Encodes this value into the given encoder, when the type’s RawValue is Int32.

func encode(to: Encoder)

Encodes this value into the given encoder, when the type’s RawValue is Int64.

func encode(to: Encoder)

Encodes this value into the given encoder, when the type’s RawValue is UInt8.

func encode(to: Encoder)

Encodes this value into the given encoder, when the type’s RawValue is UInt16.

func encode(to: Encoder)

Encodes this value into the given encoder, when the type’s RawValue is UInt32.

func encode(to: Encoder)

Encodes this value into the given encoder, when the type’s RawValue is UInt64.