pub(crate) struct Storage {
mem: PageManager,
}
Fields§
§mem: PageManager
Implementations§
source§impl Storage
impl Storage
pub(crate) fn new(mmap: MmapMut) -> Result<Storage, Error>
pub(crate) fn get_or_create_table(&self, name: &[u8]) -> Result<u64, Error>
pub(crate) fn insert<K: RadbKey + ?Sized>( &self, table_id: u64, key: &[u8], value: &[u8] ) -> Result<(), Error>
pub(crate) fn bulk_insert<K: RadbKey + ?Sized>( &self, table_id: u64, entries: HashMap<Vec<u8>, Vec<u8>> ) -> Result<(), Error>
sourcepub(crate) fn len(
&self,
table: u64,
root_page: Option<u64>
) -> Result<usize, Error>
pub(crate) fn len( &self, table: u64, root_page: Option<u64> ) -> Result<usize, Error>
Get the number of entries
pub(crate) fn get_root_page_number(&self) -> Option<u64>
fn get_root_page(&self) -> Option<Page<'_>>
fn set_root_page(&self, root_page: Option<u64>)
pub(crate) fn fsync(&self) -> Result<(), Error>
pub(crate) fn get<K: RadbKey + ?Sized>( &self, table_id: u64, key: &[u8], root_page_number: Option<u64> ) -> Result<Option<AccessGuard<'_>>, Error>
pub(crate) fn get_range<'a, T: RangeBounds<&'a [u8]>, K: RadbKey + ?Sized>( &'a self, table_id: u64, range: T, root_page: Option<u64> ) -> Result<BinarytreeRangeIter<'_, T, K>, Error>
pub(crate) fn get_range_reversed<'a, T: RangeBounds<&'a [u8]>, K: RadbKey + ?Sized>( &'a self, table_id: u64, range: T, root_page: Option<u64> ) -> Result<BinarytreeRangeIter<'_, T, K>, Error>
pub(crate) fn remove<K: RadbKey + ?Sized>( &self, table_id: u64, key: &[u8] ) -> Result<bool, Error>
Auto Trait Implementations§
impl !RefUnwindSafe for Storage
impl Send for Storage
impl !Sync for Storage
impl Unpin for Storage
impl UnwindSafe for Storage
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