pub struct LockBucket { /* private fields */ }
Expand description
Bucket implemented with a Mutex for sync and lock.
Trait Implementations§
Source§impl Debug for LockBucket
impl Debug for LockBucket
Source§impl Default for LockBucket
impl Default for LockBucket
Source§impl TwoBucket for LockBucket
impl TwoBucket for LockBucket
Source§fn get(&self, hash: HashKind) -> Option<Entry>
fn get(&self, hash: HashKind) -> Option<Entry>
Returns an entry if its corresponding hash exists in this bucket.
If no entry’s hash matches the given hash, returns None.
Source§fn contains(&self, hash: HashKind) -> bool
fn contains(&self, hash: HashKind) -> bool
Returns true if this bucket has any entry which contains the given hash.
Source§fn store(&self, general_entry: Entry)
fn store(&self, general_entry: Entry)
Unconditionally store the entry in the general slot, without updating age.
Source§fn replace(&self, priority_entry: Entry, age: AgeKind)
fn replace(&self, priority_entry: Entry, age: AgeKind)
Unconditionally place the entry in the priority slot and update age.
Source§fn swap_replace(&self, priority_entry: Entry, age: AgeKind)
fn swap_replace(&self, priority_entry: Entry, age: AgeKind)
Move the existing priority entry to the general slot,
then place the new priority entry into the priority slot and update age.
Source§fn replace_by<F>(&self, entry: Entry, age: AgeKind, should_replace: F)
fn replace_by<F>(&self, entry: Entry, age: AgeKind, should_replace: F)
Replaces the
priority
slot if should_replace
returns true,
otherwise the general
slot is replaced. Read moreAuto Trait Implementations§
impl !Freeze for LockBucket
impl RefUnwindSafe for LockBucket
impl Send for LockBucket
impl Sync for LockBucket
impl Unpin for LockBucket
impl UnwindSafe for LockBucket
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