Expand description
Swift encoding expression/statement generation.
Generates Swift code that encodes values into an inout ByteBuffer.
All encode functions are void — they append into the buffer rather than
returning a new [UInt8].
Functions§
- generate_
encode_ closure - Generate a Swift encode closure
(T, inout ByteBuffer) -> Voidfor use withencodeVec,encodeOption, etc. - generate_
encode_ stmt - Generate a Swift encode statement for a given shape and value.
The statement appends into the implicit
buffer: inout ByteBufferin scope. - generate_
named_ type_ encode_ fn - Generate a top-level Swift encode function for a named struct or enum.
e.g.
internal func encodeGnarlyPayload(_ value: GnarlyPayload, into buffer: inout ByteBuffer) - generate_
named_ type_ encode_ fns - Generate encode functions for all named types.
- named_
type_ encode_ fn_ name - The name of the generated encode function for a named type.
- swift_
encode_ fn - Get the Swift encode function name for a scalar type.