Struct RandomState

struct RandomState { ... }

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::hash::RandomState;

let s = RandomState::new();
let mut map = HashMap::with_hasher(s);
map.insert(1, 2);

Implementations

impl RandomState

fn new() -> RandomState

Constructs a new RandomState that is initialized with random keys.

Examples

use std::hash::RandomState;

let s = RandomState::new();

impl BuildHasher for RandomState

fn build_hasher(self: &Self) -> DefaultHasher

impl Clone for RandomState

fn clone(self: &Self) -> RandomState

impl Debug for RandomState

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Default for RandomState

fn default() -> RandomState

Constructs a new RandomState.

impl Freeze for RandomState

impl RefUnwindSafe for RandomState

impl Send for RandomState

impl Sync for RandomState

impl Unpin for RandomState

impl UnsafeUnpin for RandomState

impl UnwindSafe for RandomState

impl<T> Any for RandomState

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for RandomState

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for RandomState

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for RandomState

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for RandomState

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for RandomState

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for RandomState

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for RandomState

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for RandomState

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>