Struct stretto::DefaultKeyBuilder
source · [−]pub struct DefaultKeyBuilder { /* 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
sourceimpl Debug for DefaultKeyBuilder
impl Debug for DefaultKeyBuilder
sourceimpl Default for DefaultKeyBuilder
impl Default for DefaultKeyBuilder
sourcefn default() -> DefaultKeyBuilder
fn default() -> DefaultKeyBuilder
Returns the “default value” for a type. Read more
sourceimpl<K: Hash + Eq + ?Sized> KeyBuilder<K> for DefaultKeyBuilder
impl<K: Hash + Eq + ?Sized> KeyBuilder<K> for DefaultKeyBuilder
sourcefn hash_index(&self, key: &K) -> u64
fn hash_index(&self, key: &K) -> u64
hash_index is used to hash the key to u64
sourcefn hash_conflict(&self, key: &K) -> u64
fn hash_conflict(&self, key: &K) -> u64
if you want a 128bit hashes, you should implement this method, or leave this method return 0 Read more
Auto Trait Implementations
impl RefUnwindSafe for DefaultKeyBuilder
impl Send for DefaultKeyBuilder
impl Sync for DefaultKeyBuilder
impl Unpin for DefaultKeyBuilder
impl UnwindSafe for DefaultKeyBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more