pub struct CachedDbSetAccess<TKey, TData, S = RandomState, W = RandomState>{ /* private fields */ }Expand description
A concurrent DB store for set access with typed caching.
Implementations§
Source§impl<TKey, TData, S, W> CachedDbSetAccess<TKey, TData, S, W>
impl<TKey, TData, S, W> CachedDbSetAccess<TKey, TData, S, W>
pub fn new(db: Arc<DB>, cache_policy: CachePolicy, prefix: Vec<u8>) -> Self
pub fn read_from_cache(&self, key: TKey) -> Option<ReadLock<HashSet<TData, W>>>
pub fn read(&self, key: TKey) -> Result<ReadLock<HashSet<TData, W>>, StoreError>
pub fn write( &self, writer: impl DbWriter, key: TKey, data: TData, ) -> Result<(), StoreError>
pub fn delete_bucket( &self, writer: impl DbWriter, key: TKey, ) -> Result<(), StoreError>
pub fn delete( &self, writer: impl DbWriter, key: TKey, data: TData, ) -> Result<(), StoreError>
pub fn prefix(&self) -> &[u8] ⓘ
Trait Implementations§
Source§impl<TKey, TData, S: Clone, W> Clone for CachedDbSetAccess<TKey, TData, S, W>
impl<TKey, TData, S: Clone, W> Clone for CachedDbSetAccess<TKey, TData, S, W>
Source§fn clone(&self) -> CachedDbSetAccess<TKey, TData, S, W>
fn clone(&self) -> CachedDbSetAccess<TKey, TData, S, W>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<TKey, TData, S, W> Freeze for CachedDbSetAccess<TKey, TData, S, W>
impl<TKey, TData, S = RandomState, W = RandomState> !RefUnwindSafe for CachedDbSetAccess<TKey, TData, S, W>
impl<TKey, TData, S, W> Send for CachedDbSetAccess<TKey, TData, S, W>
impl<TKey, TData, S, W> Sync for CachedDbSetAccess<TKey, TData, S, W>
impl<TKey, TData, S, W> Unpin for CachedDbSetAccess<TKey, TData, S, W>
impl<TKey, TData, S = RandomState, W = RandomState> !UnwindSafe for CachedDbSetAccess<TKey, TData, S, W>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more