pub struct DefaultKeyBuilder<K> { /* private fields */ }Expand description
DefaultKeyBuilder is a built-in KeyBuilder for the Cache.
If the key implements TransparentKey trait, use TransparentKeyBuilder.
u8, u16, u32, u64, i8, i16, i32, i64, bool implement TransparentKey by default.
See KeyBuilder if you want to write a customized KeyBuilder.
Trait Implementations§
Source§impl<K> Debug for DefaultKeyBuilder<K>
impl<K> Debug for DefaultKeyBuilder<K>
Source§impl<K> Default for DefaultKeyBuilder<K>
impl<K> Default for DefaultKeyBuilder<K>
Source§impl<K: Hash + Eq> KeyBuilder for DefaultKeyBuilder<K>
impl<K: Hash + Eq> KeyBuilder for DefaultKeyBuilder<K>
Source§fn hash_index<Q>(&self, key: &Q) -> u64
fn hash_index<Q>(&self, key: &Q) -> u64
hash_index is used to hash the key to u64Source§fn hash_conflict<Q>(&self, key: &Q) -> u64
fn hash_conflict<Q>(&self, key: &Q) -> u64
if you want a 128bit hashes, you should implement this method,
or leave this method return 0
Auto Trait Implementations§
impl<K> Freeze for DefaultKeyBuilder<K>
impl<K> RefUnwindSafe for DefaultKeyBuilder<K>where
K: RefUnwindSafe,
impl<K> Send for DefaultKeyBuilder<K>where
K: Send,
impl<K> Sync for DefaultKeyBuilder<K>where
K: Sync,
impl<K> Unpin for DefaultKeyBuilder<K>where
K: Unpin,
impl<K> UnwindSafe for DefaultKeyBuilder<K>where
K: 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