Generic Instance Method

encode(_:)

Encodes a single value of the given type.

Required.

Declaration

mutating func encode<T>(_ value: T) throws where T : Encodable

Parameters

value

The value to encode.

Discussion

Precondition: May not be called after a previous self.encode(_:) call.