bookclerk_plugin_abi::json_bytes

Development These docs follow the development version and change with every merge.

Last updated View as Markdown

Serde helpers projecting Cap'n Proto Data fields as base64 text in JSON.

The typed ABI travels as Cap'n Proto; JSON projections exist only for transport-private bridges (the workerd HTTP bridge), operator diagnostics, and tests. Bytes serialize as standard base64 (padded) and deserialize from either base64 text or a JSON number array, so hand-written fixtures stay readable.

Item Kind Summary
encode function Encodes bytes as standard base64 text (bridge JSON projection).
decode_text function Decodes standard base64 text.

Modules

  • b64: Vec<u8> as base64 text.
  • opt_b64: Option<Vec<u8>> as base64 text; null/absent is None.

Functions

encode

pub fn encode(bytes: &[u8]) -> String

Encodes bytes as standard base64 text (bridge JSON projection).

decode_text

pub fn decode_text(text: &str) -> Result<Vec<u8>, String>

Decodes standard base64 text.

Errors

Returns when the text is not valid base64.

Generated from crates/bookclerk-plugin-abi at main · View as Markdown