Trait tower::util::rng::Rng

source ·
pub trait Rng {
    // Required method
    fn next_u64(&mut self) -> u64;

    // Provided methods
    fn next_f64(&mut self) -> f64 { ... }
    fn next_range(&mut self, range: Range<u64>) -> u64 { ... }
}
Expand description

A simple PRNG trait for use within tower middleware.

Required Methods§

source

fn next_u64(&mut self) -> u64

Generate a random u64.

Provided Methods§

source

fn next_f64(&mut self) -> f64

Generate a random f64 between [0, 1).

source

fn next_range(&mut self, range: Range<u64>) -> u64

Randomly pick a value within the range.

§Panic
  • If start < end this will panic in debug mode.

Implementations on Foreign Types§

source§

impl<R: Rng + ?Sized> Rng for Box<R>

source§

fn next_u64(&mut self) -> u64

Implementors§

source§

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