Marshaler

Trait Marshaler 

Source
pub trait Marshaler: Send + Sync {
    // Required methods
    fn serialize(
        &self,
        state: &StoreState,
    ) -> Result<Vec<u8>, Box<dyn Error + Send + Sync>>;
    fn deserialize(
        &self,
        bytes: &[u8],
    ) -> Result<StoreState, Box<dyn Error + Send + Sync>>;

    // Provided method
    fn extension(&self) -> &'static str { ... }
}
Expand description

Describes how stores should be serialized and deserialized.

Required Methods§

Source

fn serialize( &self, state: &StoreState, ) -> Result<Vec<u8>, Box<dyn Error + Send + Sync>>

Source

fn deserialize( &self, bytes: &[u8], ) -> Result<StoreState, Box<dyn Error + Send + Sync>>

Provided Methods§

Source

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

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

Implementors§