Contents

encode(_:to:)

Encodes a value to the provided encoder.

Declaration

static func encode(_ value: Self.Value, to encoder: any Encoder) throws

Parameters

  • value:

    The value to encode.

  • encoder:

    The encoder to write data to.

Discussion

This method throws an error if writing to the encoder fails.