pub trait Marshaler: Send + Sync {
// Required methods
fn serialize(&self, state: &StoreState) -> Result<Vec<u8>, MarshalingError>;
fn deserialize(&self, bytes: &[u8]) -> Result<StoreState, MarshalingError>;
// Provided method
fn extension(&self) -> &'static str { ... }
}Expand description
Describes how stores should be serialized and deserialized.
Required Methods§
fn serialize(&self, state: &StoreState) -> Result<Vec<u8>, MarshalingError>
fn deserialize(&self, bytes: &[u8]) -> Result<StoreState, MarshalingError>
Provided Methods§
Implementors§
impl Marshaler for JsonMarshaler
impl Marshaler for PrettyJsonMarshaler
impl Marshaler for PrettyTomlMarshaler
Available on crate feature
marshaler-toml only.impl Marshaler for TomlMarshaler
Available on crate feature
marshaler-toml only.