Module decode

Module decode 

Source
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_name is the variable to assign the result to. offset_var is 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.