Marshaler

Trait Marshaler 

Source
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§

Provided Methods§

Source

fn extension(&self) -> &'static str

Extension with which the store will be saved. Defaults to store.

Implementors§

Source§

impl Marshaler for JsonMarshaler

Source§

impl Marshaler for PrettyJsonMarshaler

Source§

impl Marshaler for PrettyTomlMarshaler

Available on crate feature marshaler-toml only.
Source§

impl Marshaler for TomlMarshaler

Available on crate feature marshaler-toml only.