pub struct StackDB<'l, A: Allocator<'l>> { /* private fields */ }
Implementations§
Source§impl<'l, A: Allocator<'l>> StackDB<'l, A>
impl<'l, A: Allocator<'l>> StackDB<'l, A>
Sourcepub fn new(alloc: A) -> Result<Self, Error>
pub fn new(alloc: A) -> Result<Self, Error>
creates a database interface; either loads an existing db or creates a new one.
Sourcepub fn read(&mut self, addr: Range<u64>) -> Result<Box<[u8]>, Error>
pub fn read(&mut self, addr: Range<u64>) -> Result<Box<[u8]>, Error>
Reads data from either the heap or disk layers
Sourcepub fn rebase(&mut self, buffer_size: u64) -> Result<(), Error>
pub fn rebase(&mut self, buffer_size: u64) -> Result<(), Error>
Rebases and drops overwritten layers (the database history) by compressing all the layers into one to save space
Warning: will temporarity double database size
Trait Implementations§
Auto Trait Implementations§
impl<'l, A> Freeze for StackDB<'l, A>where
A: Freeze,
impl<'l, A> RefUnwindSafe for StackDB<'l, A>
impl<'l, A> Send for StackDB<'l, A>
impl<'l, A> Sync for StackDB<'l, A>
impl<'l, A> Unpin for StackDB<'l, A>
impl<'l, A> UnwindSafe for StackDB<'l, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more