Struct HasherRng

pub struct HasherRng<H = RandomState> { /* private fields */ }

A Rng implementation that uses a Hasher to generate the random values. The implementation uses an internal counter to pass to the hasher for each iteration of Rng::next_u64.

Default

This hasher has a default type of RandomState which just uses the libstd method of getting a random u64.

Implementations

impl HasherRng

fn new() -> Self

Create a new default HasherRng.

impl<H> HasherRng<H>

fn with_hasher(hasher: H) -> Self

Create a new HasherRng with the provided hasher.

Trait Implementations

impl Default for HasherRng

fn default() -> Self

impl<H> Rng for HasherRng<H> where H: BuildHasher,

fn next_u64(&mut self) -> u64

impl<H: Clone> Clone for HasherRng<H>

fn clone(&self) -> HasherRng<H>

impl<H: Debug> Debug for HasherRng<H>

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

Auto Trait Implementations

impl<H> Freeze for HasherRng<H> where H: Freeze,

impl<H> RefUnwindSafe for HasherRng<H> where H: RefUnwindSafe,

impl<H> Send for HasherRng<H> where H: Send,

impl<H> Sync for HasherRng<H> where H: Sync,

impl<H> Unpin for HasherRng<H> where H: Unpin,

impl<H> UnsafeUnpin for HasherRng<H> where H: UnsafeUnpin,

impl<H> UnwindSafe for HasherRng<H> where H: UnwindSafe,

Blanket Implementations

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

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for HasherRng<H> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for HasherRng<H> where T: ?Sized,

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

impl<T> CloneToUninit for HasherRng<H> where T: Clone,

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

impl<T> From<T> for HasherRng<H>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for HasherRng<H>

impl<T> ToOwned for HasherRng<H> where T: Clone,

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

impl<T> WithSubscriber for HasherRng<H>

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

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

impl<T, U> TryInto<U> for HasherRng<H> where U: TryFrom<T>,

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