[][src]Struct random_fast_rng::FastRng

pub struct FastRng { /* fields omitted */ }

Methods

impl FastRng[src]

pub fn new() -> Self[src]

pub fn thread_local() -> ThreadFastRng[src]

pub fn seed(seed: u64, seq: u64) -> Self[src]

Trait Implementations

impl Random for FastRng[src]

type Error = ()

The Error type, based on the source of randomness, non fallible sources can use Error=()

fn fill_bytes(&mut self, buf: &mut [u8])[src]

Uses try_fill_bytes but panics if returns an error. Override if you can gracefully handle errors in the randomness source. Read more

fn gen<T>(&mut self) -> T where
    T: GenerateRand
[src]

Returns a generic random value which implements GenerateRand

fn get_u8(&mut self) -> u8[src]

Returns a random u8 number.

fn get_u16(&mut self) -> u16[src]

Returns a random u16 number.

fn get_u64(&mut self) -> u64[src]

Returns a random u64 number.

fn get_usize(&mut self) -> usize[src]

Returns a random usize number.

fn get_u128(&mut self) -> u128[src]

Returns a random u128 number.

fn get_bool(&mut self) -> bool[src]

Returns a random bool with 50/50 probability.

Auto Trait Implementations

impl Unpin for FastRng

impl Send for FastRng

impl Sync for FastRng

impl UnwindSafe for FastRng

impl RefUnwindSafe for FastRng

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]