[][src]Trait splinter::storage::Storage

pub trait Storage {
    type S;
    fn read<'a>(
        &'a self
    ) -> Box<dyn StorageReadGuard<'a, Self::S, Target = Self::S> + 'a>;
fn write<'a>(
        &'a mut self
    ) -> Box<dyn StorageWriteGuard<'a, Self::S, Target = Self::S> + 'a>; }

Storage wrapper that ensures that changes to an object are persisted to a backing store

Achieves this by handing out RAII-guarded references to the underlying data, that ensure persistence when they get Dropped.

Associated Types

type S

Loading content...

Required methods

fn read<'a>(
    &'a self
) -> Box<dyn StorageReadGuard<'a, Self::S, Target = Self::S> + 'a>

fn write<'a>(
    &'a mut self
) -> Box<dyn StorageWriteGuard<'a, Self::S, Target = Self::S> + 'a>

Loading content...

Implementors

impl<T: Serialize + DeserializeOwned> Storage for MemStorage<T>[src]

type S = T

impl<T: Serialize + DeserializeOwned> Storage for YamlStorage<T>[src]

type S = T

Loading content...