Skip to main content

Module json

Module json 

Source
Expand description

§Thin JSON (de)serialisation helpers

Four trivial wrappers over serde_json that return anyhow::Result and either Bytes or String. The point is consistency: every caller in the codebase goes through these helpers instead of sprinkling serde_json::to_vec / from_slice calls, so error handling and encoding choices stay uniform.

JSON is used for the rare human-readable persisted blobs (configuration, on-disk key locker entries). Wire-format payloads go through the hand-rolled binary encoders in crate::protocol instead.

Functions§

bytes_to_struct
string_to_struct
struct_to_bytes
struct_to_string