Struct rand::rngs::adapter::reseeding::ReseedingCore

source ·
struct ReseedingCore<R, Rsdr> {
    inner: R,
    reseeder: Rsdr,
    threshold: i64,
    bytes_until_reseed: i64,
    fork_counter: usize,
}

Fields§

§inner: R§reseeder: Rsdr§threshold: i64§bytes_until_reseed: i64§fork_counter: usize

Implementations§

source§

impl<R, Rsdr> ReseedingCore<R, Rsdr>
where R: BlockRngCore + SeedableRng, Rsdr: RngCore,

source

fn new(rng: R, threshold: u64, reseeder: Rsdr) -> Self

Create a new ReseedingCore.

source

fn reseed(&mut self) -> Result<(), Error>

Reseed the internal PRNG.

source

fn is_forked(&self, global_fork_counter: usize) -> bool

source

fn reseed_and_generate( &mut self, results: &mut <Self as BlockRngCore>::Results, global_fork_counter: usize, )

Trait Implementations§

source§

impl<R, Rsdr> BlockRngCore for ReseedingCore<R, Rsdr>
where R: BlockRngCore + SeedableRng, Rsdr: RngCore,

§

type Item = <R as BlockRngCore>::Item

Results element type, e.g. u32.
§

type Results = <R as BlockRngCore>::Results

Results type. This is the ‘block’ an RNG implementing BlockRngCore generates, which will usually be an array like [u32; 16].
source§

fn generate(&mut self, results: &mut Self::Results)

Generate a new block of results.
source§

impl<R, Rsdr> Clone for ReseedingCore<R, Rsdr>
where R: BlockRngCore + SeedableRng + Clone, Rsdr: RngCore + Clone,

source§

fn clone(&self) -> ReseedingCore<R, Rsdr>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<R: Debug, Rsdr: Debug> Debug for ReseedingCore<R, Rsdr>

source§

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

Formats the value using the given formatter. Read more
source§

impl<R, Rsdr> CryptoRng for ReseedingCore<R, Rsdr>

Auto Trait Implementations§

§

impl<R, Rsdr> Freeze for ReseedingCore<R, Rsdr>
where R: Freeze, Rsdr: Freeze,

§

impl<R, Rsdr> RefUnwindSafe for ReseedingCore<R, Rsdr>
where R: RefUnwindSafe, Rsdr: RefUnwindSafe,

§

impl<R, Rsdr> Send for ReseedingCore<R, Rsdr>
where R: Send, Rsdr: Send,

§

impl<R, Rsdr> Sync for ReseedingCore<R, Rsdr>
where R: Sync, Rsdr: Sync,

§

impl<R, Rsdr> Unpin for ReseedingCore<R, Rsdr>
where R: Unpin, Rsdr: Unpin,

§

impl<R, Rsdr> UnwindSafe for ReseedingCore<R, Rsdr>
where R: UnwindSafe, Rsdr: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V