pub struct KVStore<A, const BUCKETS: usize, const SLOTS: usize>where
A: StoreAdapter,{ /* private fields */ }Implementations§
Source§impl<E, A, const BUCKETS: usize, const SLOTS: usize> KVStore<A, BUCKETS, SLOTS>where
A: StoreAdapter<Error = E>,
impl<E, A, const BUCKETS: usize, const SLOTS: usize> KVStore<A, BUCKETS, SLOTS>where
A: StoreAdapter<Error = E>,
pub fn open( adapter: A, cfg: StoreConfig, create_new: bool, ) -> Result<Self, Error<E>>
pub fn create(adapter: A, cfg: StoreConfig) -> Result<Self, Error<E>>
pub fn adapter(&mut self) -> &mut A
pub fn close(self) -> A
pub fn reset(&mut self) -> Result<(), Error<E>>
pub fn alloc( &mut self, key: &[u8], val_len: usize, fill_with: Option<u8>, ) -> Result<Bucket, Error<E>>
pub fn insert(&mut self, key: &[u8], val: &[u8]) -> Result<Bucket, Error<E>>
pub fn append(&mut self, key: &[u8], val: &[u8]) -> Result<Bucket, Error<E>>
pub fn patch( &mut self, key: &[u8], offset: usize, patch: &[u8], ) -> Result<Bucket, Error<E>>
pub fn load(&mut self, key: &[u8], buf: &mut [u8]) -> Result<Bucket, Error<E>>
pub fn load_slice<'a>( &mut self, key: &[u8], buf: &'a mut [u8], ) -> Result<&'a [u8], Error<E>>
pub fn load_str<'a>( &mut self, key: &[u8], buf: &'a mut [u8], ) -> Result<&'a str, Error<E>>
pub fn load_at( &mut self, key: &[u8], buf: &mut [u8], offset: usize, ) -> Result<Bucket, Error<E>>
pub fn erase(&mut self, key: &[u8], fill_with: u8) -> Result<(), Error<E>>
pub fn remove(&mut self, key: &[u8]) -> Result<(), Error<E>>
pub fn keys(&mut self) -> KeysIterator<'_, '_, A, BUCKETS, SLOTS> ⓘ
pub fn keys_with_prefix<'a>( &mut self, pat: &'a [u8], ) -> KeysIterator<'_, 'a, A, BUCKETS, SLOTS> ⓘ
pub fn exists(&mut self, key: &[u8]) -> Result<bool, Error<E>>
pub fn lookup(&mut self, key: &[u8]) -> Result<Bucket, Error<E>>
Auto Trait Implementations§
impl<A, const BUCKETS: usize, const SLOTS: usize> Freeze for KVStore<A, BUCKETS, SLOTS>where
A: Freeze,
impl<A, const BUCKETS: usize, const SLOTS: usize> RefUnwindSafe for KVStore<A, BUCKETS, SLOTS>where
A: RefUnwindSafe,
impl<A, const BUCKETS: usize, const SLOTS: usize> Send for KVStore<A, BUCKETS, SLOTS>where
A: Send,
impl<A, const BUCKETS: usize, const SLOTS: usize> Sync for KVStore<A, BUCKETS, SLOTS>where
A: Sync,
impl<A, const BUCKETS: usize, const SLOTS: usize> Unpin for KVStore<A, BUCKETS, SLOTS>where
A: Unpin,
impl<A, const BUCKETS: usize, const SLOTS: usize> UnwindSafe for KVStore<A, BUCKETS, SLOTS>where
A: UnwindSafe,
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