Expand description
TypeScript decoding statement generation.
Generates TypeScript code that decodes byte arrays into Rust types.
Functions§
- generate_
decode_ fn - Generate a decode function expression for use with decodeVec, decodeOption, etc.
- generate_
decode_ fn_ inline - Generate an inline decode function for a type.
- generate_
decode_ stmt - Generate TypeScript code that decodes a value from a buffer.
Returns the decoded value in a variable and updates offset.
var_nameis the variable to assign the result to.offset_varis the variable holding the current offset. - generate_
decode_ stmt_ client - Generate TypeScript code that decodes a value from a buffer for CLIENT context. Schema is from server’s perspective - types match on both sides.
- generate_
decode_ stmt_ server - Generate TypeScript code that decodes a value from a buffer for SERVER context. Schema is from server’s perspective - no inversion needed.
- generate_
decode_ stmt_ server_ streaming - Generate decode statement for server-side streaming context. Creates real Tx/Rx handles using the registry and taskSender.