pub struct ConcurrentMaplet<K, V, Op>where
K: Hash + Eq + Clone + Send + Sync + Debug,
V: Clone + Send + Sync + Debug,
Op: MergeOperator<V> + Send + Sync,{ /* private fields */ }
Expand description
Thread-safe maplet wrapper
Implementations§
Source§impl<K, V, Op> ConcurrentMaplet<K, V, Op>
impl<K, V, Op> ConcurrentMaplet<K, V, Op>
Sourcepub fn new(
capacity: usize,
false_positive_rate: f64,
) -> Result<ConcurrentMaplet<K, V, Op>, MapletError>
pub fn new( capacity: usize, false_positive_rate: f64, ) -> Result<ConcurrentMaplet<K, V, Op>, MapletError>
Create a new concurrent maplet
Sourcepub async fn insert(&self, key: K, value: V) -> Result<(), MapletError>
pub async fn insert(&self, key: K, value: V) -> Result<(), MapletError>
Insert a key-value pair (write lock)
Sourcepub async fn delete(&self, key: &K, value: &V) -> Result<bool, MapletError>
pub async fn delete(&self, key: &K, value: &V) -> Result<bool, MapletError>
Delete a key-value pair (write lock)
Sourcepub async fn stats(&self) -> MapletStats
pub async fn stats(&self) -> MapletStats
Get statistics (read lock)
Trait Implementations§
Source§impl<K, V, Op> Debug for ConcurrentMaplet<K, V, Op>
impl<K, V, Op> Debug for ConcurrentMaplet<K, V, Op>
Auto Trait Implementations§
impl<K, V, Op> Freeze for ConcurrentMaplet<K, V, Op>
impl<K, V, Op> !RefUnwindSafe for ConcurrentMaplet<K, V, Op>
impl<K, V, Op> Send for ConcurrentMaplet<K, V, Op>
impl<K, V, Op> Sync for ConcurrentMaplet<K, V, Op>
impl<K, V, Op> Unpin for ConcurrentMaplet<K, V, Op>
impl<K, V, Op> !UnwindSafe for ConcurrentMaplet<K, V, Op>
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