[][src]Struct orga::store::BufStore

pub struct BufStore<S: Store> { /* fields omitted */ }

Wraps a Store and records mutations in an in-memory map, so that modifications do not affect the underlying Store until flush is called.

Implementations

impl BufStore<NullStore>[src]

pub fn new() -> Self[src]

Constructs a BufStore with no underlying store.

impl<S: Store> BufStore<S>[src]

pub fn wrap(store: S) -> Self[src]

Constructs a BufStore by wrapping the given store.

Calls to get will first check the BufStore map, and if no entry is found will be passed to the underlying store.

pub fn wrap_with_map(store: S, map: Map) -> Self[src]

Creates a BufStore by wrapping the given store, using a pre-populated in-memory buffer of key/value entries.

pub fn into_map(self) -> Map[src]

Consumes the BufStore and returns its in-memory buffer of key/value entries.

Trait Implementations

impl Default for BufStore<NullStore>[src]

impl<S: Store> Flush for BufStore<S>[src]

fn flush(&mut self) -> Result<()>[src]

Consumes the BufStore's in-memory buffer and writes all of its values to the underlying store.

After calling flush, the BufStore will still be valid and wrap the underlying store, but its in-memory buffer will be empty.

impl<'a, S> Iter<'a> for BufStore<S> where
    S: Store + Iter<'a> + 'a, 
[src]

type Iter = Iter<'a, S::Iter>

impl<S: Store> Read for BufStore<S>[src]

impl<S: Store> Write for BufStore<S>[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for BufStore<S> where
    S: RefUnwindSafe

impl<S> Send for BufStore<S> where
    S: Send

impl<S> Sync for BufStore<S> where
    S: Sync

impl<S> Terminated for BufStore<S> where
    S: Terminated

impl<S> Unpin for BufStore<S> where
    S: Unpin

impl<S> UnwindSafe for BufStore<S> where
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> From<T> for T[src]

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<S, T> Read for T where
    S: Read,
    T: Deref<Target = S>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<S> Store for S where
    S: Read + Write
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<S, T> Write for T where
    S: Write,
    T: DerefMut<Target = S>, 
[src]