[−][src]Struct orga::store::BufStore
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]
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]
S: Store + Iter<'a> + 'a,
type Iter = Iter<'a, S::Iter>
fn iter_from(&'a self, start: &[u8]) -> Self::Iter
[src]
fn iter(&'a self) -> Self::Iter
[src]
impl<S: Store> Read for BufStore<S>
[src]
fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>
[src]
fn wrap<T: State<Self>>(self) -> Result<T>
[src]
fn into_shared(self) -> Shared<Self>
[src]
fn prefix(self, prefix: u8) -> Prefixed<Self>
[src]
fn into_splitter(self) -> Splitter<Self>
[src]
fn as_ref<'a>(&'a self) -> &'a Self
[src]
impl<S: Store> Write for BufStore<S>
[src]
Auto Trait Implementations
impl<S> RefUnwindSafe for BufStore<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for BufStore<S> where
S: Send,
S: Send,
impl<S> Sync for BufStore<S> where
S: Sync,
S: Sync,
impl<S> Terminated for BufStore<S> where
S: Terminated,
S: Terminated,
impl<S> Unpin for BufStore<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for BufStore<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Clear for T where
T: InitializableFromZeroed + ?Sized,
T: InitializableFromZeroed + ?Sized,
fn clear(&mut self)
impl<T> From<T> for T
[src]
impl<T> InitializableFromZeroed for T where
T: Default,
T: Default,
unsafe fn initialize(place: *mut T)
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<S, T> Read for T where
S: Read,
T: Deref<Target = S>,
[src]
S: Read,
T: Deref<Target = S>,
fn get(&Self, &[u8]) -> Result<Option<Vec<u8>>, Error>
[src]
fn wrap<T: State<Self>>(self) -> Result<T>
[src]
fn into_shared(self) -> Shared<Self>
[src]
fn prefix(self, prefix: u8) -> Prefixed<Self>
[src]
fn into_splitter(self) -> Splitter<Self>
[src]
fn as_ref<'a>(&'a self) -> &'a Self
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<S> Store for S where
S: Read + Write,
[src]
S: Read + Write,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<S, T> Write for T where
S: Write,
T: DerefMut<Target = S>,
[src]
S: Write,
T: DerefMut<Target = S>,