Struct SeedableRandomState

pub struct SeedableRandomState { /* private fields */ }

A BuildHasher for fast::FoldHasher that is randomly initialized by default, but can also be initialized with a specific seed.

This can be useful for e.g. testing, but the downside is that this type has a size of 16 bytes rather than the 8 bytes RandomState is.

Implementations

impl SeedableRandomState

fn random() -> Self

Generates a random SeedableRandomState, similar to RandomState.

fn fixed() -> Self

Generates a fixed SeedableRandomState, similar to FixedState.

fn with_seed(per_hasher_seed: u64, shared_seed: &'static SharedSeed) -> Self

Generates a SeedableRandomState with the given per-hasher seed and SharedSeed.

Trait Implementations

impl BuildHasher for SeedableRandomState

type Hasher = FoldHasher<'static>;
fn build_hasher(&self) -> FoldHasher<'static>

impl Clone for SeedableRandomState

fn clone(&self) -> SeedableRandomState

impl Debug for SeedableRandomState

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

impl Default for SeedableRandomState

fn default() -> Self

Auto Trait Implementations

impl Freeze for SeedableRandomState

impl RefUnwindSafe for SeedableRandomState

impl Send for SeedableRandomState

impl Sync for SeedableRandomState

impl Unpin for SeedableRandomState

impl UnsafeUnpin for SeedableRandomState

impl UnwindSafe for SeedableRandomState

Blanket Implementations

impl<T> Any for SeedableRandomState where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for SeedableRandomState where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for SeedableRandomState where T: ?Sized,

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

impl<T> CloneToUninit for SeedableRandomState where T: Clone,

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

impl<T> From<T> for SeedableRandomState

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for SeedableRandomState where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for SeedableRandomState where U: From<T>,

fn into(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<U> for SeedableRandomState where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for SeedableRandomState where U: TryFrom<T>,

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