Skip to main content

encode

Function encode 

Source
pub fn encode(entry: &WalEntry) -> Result<Vec<u8>, CodecError>
Expand description

Encode a WalEntry into the compact binary v1 format.

The returned Vec<u8> can be passed directly to the WAL writer. The encoding is ~5–10× smaller and faster than the previous JSON format.

§Errors

Returns CodecError::Postcard when postcard serialization fails.