Skip to main content

Module decode

Module decode 

Source
Expand description

Swift decoding statement generation.

Generates Swift code that decodes byte arrays into Rust types.

Functionsยง

generate_decode_closure
Generate a Swift decode closure for use with decodeVec, decodeOption, etc.
generate_decode_stmt
Generate a Swift decode statement for a given shape. Returns code that decodes from payload at cursor into a variable named var_name.
generate_decode_stmt_from
Generate a Swift decode statement for a given shape from a specific data variable. Returns code that decodes from data_var at cursor into a variable named var_name.
generate_decode_stmt_from_with_cursor
Generate a Swift decode statement for a given shape from a specific data variable and using a custom cursor variable name.
generate_decode_stmt_with_cursor
Generate a Swift decode statement for a given shape using a custom cursor variable name.
generate_inline_decode
Generate inline decode expression (for use in closures).
swift_decode_fn
Get the Swift decode function name for a scalar type.