pub struct Shard<K, V> {
pub table: RawTable<(K, V)>,
}
Expand description
Shard embeds a table that contains key/value pair.
Fields§
§table: RawTable<(K, V)>
Implementations§
Source§impl<K: Clone + Send + Sync, V: Clone + Send + Sync> Shard<K, V>
impl<K: Clone + Send + Sync, V: Clone + Send + Sync> Shard<K, V>
Sourcepub fn get<'a>(&'a self, key: &K, hash: u64) -> Option<&'a V>
pub fn get<'a>(&'a self, key: &K, hash: u64) -> Option<&'a V>
get fetches a option containing a reference to the value associated with the given key.
Sourcepub fn insert(&mut self, key: &K, hash: u64, value: V)
pub fn insert(&mut self, key: &K, hash: u64, value: V)
insert inserts the given key/value pair into the table.
Sourcepub fn remove(&mut self, key: &K, hash: u64) -> Option<V>
pub fn remove(&mut self, key: &K, hash: u64) -> Option<V>
remove remove the entry associated with key
and hash
from the table.
Sourcepub fn fill_pairs_into(&self, buffer: &mut Vec<(K, V)>)
pub fn fill_pairs_into(&self, buffer: &mut Vec<(K, V)>)
fil_pairs_into fills the buffer
with cloned entries
of key/value pairs.
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for Shard<K, V>
impl<K, V> RefUnwindSafe for Shard<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Shard<K, V>
impl<K, V> Sync for Shard<K, V>
impl<K, V> Unpin for Shard<K, V>
impl<K, V> UnwindSafe for Shard<K, V>where
K: UnwindSafe,
V: 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