Skip to main content

Module serde_bytes_var

Module serde_bytes_var 

Source
Expand description

Serde helper for variable-length Vec<u8> byte fields.

Default serde serializes Vec<u8> as a sequence of u8 elements. For JS / wasm consumers this is verbose and not ergonomic; we want bytes in binary formats and base64 strings in human-readable formats — matching BinaryData (the widely-used opaque-bytes wrapper in rs-platform-value) and the const-generic serde_bytes helper.

  • Human-readable formats (JSON): base64-encoded string
  • Binary formats (bincode / platform_value): raw byte sequence (which becomes Uint8Array through serde_wasm_bindgen with serialize_bytes_as_arrays(false))

Functions§

deserialize
serialize