pub struct HashState<'d> { /* private fields */ }Expand description
Keyed hash builder issued for one exact generative driver domain.
The driver lifetime is invariant and cannot be widened:
ⓘ
use dope_runtime::random::HashState;
fn escape<'d>(state: HashState<'d>) -> HashState<'static> {
state
}Construction is reserved for a runtime session holding the matching brand:
ⓘ
use dope_runtime::random::HashState;
let _ = HashState::new([1, 2]);Building a hasher preserves the same invariant driver lifetime:
ⓘ
use std::hash::BuildHasher;
use dope_runtime::random::{HashState, Hasher};
fn erase<'d>(state: HashState<'d>) -> Hasher<'static> {
state.build_hasher()
}Trait Implementations§
Source§impl<'d> BuildHasher for HashState<'d>
impl<'d> BuildHasher for HashState<'d>
impl<'d> Copy for HashState<'d>
Auto Trait Implementations§
impl<'d> !Send for HashState<'d>
impl<'d> !Sync for HashState<'d>
impl<'d> Freeze for HashState<'d>
impl<'d> RefUnwindSafe for HashState<'d>
impl<'d> Unpin for HashState<'d>
impl<'d> UnsafeUnpin for HashState<'d>
impl<'d> UnwindSafe for HashState<'d>
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