Skip to main content

Module encoding

Module encoding 

Source
Expand description

Storage encoding (MessagePack serialize/deserialize, KeyEncoder trait). Storage encoding — serialize/deserialize values for storage.

Provides encode() and decode() using MessagePack for compact binary serialization, and the KeyEncoder trait for ordered-binary key encoding.

§Errors

encode / decode and the KeyEncoder methods return Result<T, YetiError> with Encoding(EncodingError::MessagePack) on failure. Causes:

  • serialization: a Serialize impl returning an error, or a value shape unrepresentable in MessagePack.
  • deserialization: bytes not valid MessagePack, or the wire shape does not match T: DeserializeOwned.

Traits§

KeyEncoder
Trait for ordered-binary key encoding.

Functions§

decode
Deserialize bytes from storage to a value (MessagePack format).
encode
Serialize a value to bytes for storage (MessagePack format).
try_decode
Try to deserialize bytes, returning None on failure.