Expand description
Swift decoding statement generation.
Generates Swift code that decodes values from an inout ByteBuffer.
All decode functions take inout ByteBuffer and advance its reader index.
Functions§
- generate_
decode_ closure - Generate a Swift decode closure
(inout ByteBuffer) throws -> Tfor use withdecodeVec,decodeOption, etc. - generate_
decode_ stmt - Generate a Swift decode statement for a given shape.
Returns code that decodes from
bufferinto a variable namedvar_name. - generate_
decode_ stmt_ from - Generate a Swift decode statement from a specific data variable.
(data_var is now ignored — kept for call-site compatibility, buffer is always
buffer) - generate_
decode_ stmt_ from_ with_ cursor - Generate a Swift decode statement from a specific data variable and cursor. (data_var and cursor_var are now ignored — kept for call-site compatibility)
- generate_
decode_ stmt_ with_ buf - Core implementation: generate a decode statement that reads from the named buffer variable.
- generate_
decode_ stmt_ with_ cursor - Generate a Swift decode statement for a given shape using a custom cursor variable name.
(cursor_var is now ignored — kept for call-site compatibility, buffer is always
buffer) - generate_
inline_ decode - Generate inline decode expression — just the expression part, no
let x =. Used internally where a closure calls another closure. - generate_
named_ type_ decode_ fn - Generate a top-level
decode<Name>(from:)function for a named struct or enum. - generate_
named_ type_ decode_ fns - Generate decode functions for every named type.
- named_
type_ decode_ fn_ name - The name of the generated decode function for a named type.
- swift_
decode_ fn - Get the Swift decode function name for a scalar type.