Skip to main content

decode

Function decode 

Source
pub fn decode(raw: &[u8]) -> Result<(StateKey, StateValue, Option<KeyMetadata>)>
Expand description

Decode a xenith wire message into (StateKey, StateValue, Option<KeyMetadata>).

Accepts both version 2 (no metadata) and version 3 (with optional metadata). Version 2 messages always decode with metadata = None.

Returns XenithError::Serialization if the buffer is truncated, carries an unrecognised magic prefix, or uses an unsupported wire format version.