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