[−][src]Struct agilulf::MemDatabase
A simple RAM only database with skiplist as kernel.
The type of Value in skiplist is either NotExist (used for deleting element) or Slice.
Methods
impl MemDatabase
[src]
pub fn restore_from_iterator<I: Iterator<Item = Command>>(
iter: I
) -> Result<MemDatabase, StorageError>
[src]
iter: I
) -> Result<MemDatabase, StorageError>
It can read from command iterator and run every command on MemDatabase. It is very useful for restoring data from log.
pub fn large_enough(&self) -> bool
[src]
This function decide whether MemDatabase is too large. As every key and value is (256 + 8) bytes, nearly 1MB is the threshold.
Trait Implementations
impl SyncDatabase for MemDatabase
[src]
fn get_sync(&self, key: Slice) -> Result<Slice>
[src]
fn put_sync(&self, key: Slice, value: Slice) -> Result<()>
[src]
fn scan_sync(&self, start: Slice, end: Slice) -> Vec<(Slice, Slice)>
[src]
fn delete_sync(&self, key: Slice) -> Result<()>
[src]
impl Drop for MemDatabase
[src]
impl Default for MemDatabase
[src]
Auto Trait Implementations
impl Send for MemDatabase
impl Unpin for MemDatabase
impl Sync for MemDatabase
impl UnwindSafe for MemDatabase
impl RefUnwindSafe for MemDatabase
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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<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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,