Struct std::collections::hash_map::RandomState
1.7.0 · source · [−]pub struct RandomState { /* private fields */ }Expand description
RandomState is the default state for HashMap types.
A particular instance RandomState will create the same instances of
Hasher, but the hashers created by two different RandomState
instances are unlikely to produce the same result for the same values.
Examples
use std::collections::HashMap;
use std::collections::hash_map::RandomState;
let s = RandomState::new();
let mut map = HashMap::with_hasher(s);
map.insert(1, 2);RunImplementations
impl RandomState
source
impl RandomState
sourcepub fn new() -> RandomState
source
pub fn new() -> RandomState
sourceTrait Implementations
impl BuildHasher for RandomState
source
impl BuildHasher for RandomState
sourcetype Hasher = DefaultHasher
type Hasher = DefaultHasher
Type of the hasher that will be created.
fn build_hasher(&self) -> DefaultHasher
source
fn build_hasher(&self) -> DefaultHasher
sourceCreates a new hasher. Read more
impl Clone for RandomState
source
impl Clone for RandomState
sourcefn clone(&self) -> RandomState
source
fn clone(&self) -> RandomState
sourceReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0 · source
fn clone_from(&mut self, source: &Self)
1.0.0 · sourcePerforms copy-assignment from source. Read more
impl Debug for RandomState
1.16.0 · source
impl Debug for RandomState
1.16.0 · sourceimpl Default for RandomState
source
impl Default for RandomState
sourcefn default() -> RandomState
source
fn default() -> RandomState
sourceConstructs a new RandomState.
Auto Trait Implementations
impl RefUnwindSafe for RandomState
impl Send for RandomState
impl Sync for RandomState
impl Unpin for RandomState
impl UnwindSafe for RandomState
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
source
impl<T> BorrowMut<T> for T where
T: ?Sized,
sourcefn borrow_mut(&mut self) -> &mut T
const: unstable · source
fn borrow_mut(&mut self) -> &mut T
const: unstable · sourceMutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
source
impl<T> ToOwned for T where
T: Clone,
sourcetype Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
source
fn clone_into(&self, target: &mut T)
sourceUses borrowed data to replace owned data, usually by cloning. Read more