Struct SharedSeed

pub struct SharedSeed { /* private fields */ }

A random seed intended to be shared by many different foldhash instances.

This seed is consumed by FoldHasher::with_seed, and SeedableRandomState::with_seed.

Implementations

impl SharedSeed

fn global_random() -> &'static SharedSeed

Returns the globally shared randomly initialized SharedSeed as used by RandomState.

const fn global_fixed() -> &'static SharedSeed

Returns the globally shared fixed SharedSeed as used by FixedState.

const fn from_u64(seed: u64) -> Self

Generates a new SharedSeed from a single 64-bit seed.

Note that this is somewhat expensive so it is suggested to re-use the SharedSeed as much as possible, using the per-hasher seed to differentiate between hash instances.

Trait Implementations

impl Clone for SharedSeed

fn clone(&self) -> SharedSeed

impl Debug for SharedSeed

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

Auto Trait Implementations

impl Freeze for SharedSeed

impl RefUnwindSafe for SharedSeed

impl Send for SharedSeed

impl Sync for SharedSeed

impl Unpin for SharedSeed

impl UnsafeUnpin for SharedSeed

impl UnwindSafe for SharedSeed

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for SharedSeed

fn from(t: T) -> T

Returns the argument unchanged.

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

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

impl<T, U> Into<U> for SharedSeed 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 SharedSeed where U: Into<T>,

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

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

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