Struct tinyrand_std::thread_local::ThreadLocalRand
source · [−]pub struct ThreadLocalRand(_);Expand description
A seeded, thread-local Rand instance.
Trait Implementations
sourceimpl Rand for ThreadLocalRand
impl Rand for ThreadLocalRand
sourcefn next_usize(&mut self) -> usize
fn next_usize(&mut self) -> usize
Returns the next random usize.
sourcefn next_bool(&mut self, p: Probability) -> bool
fn next_bool(&mut self, p: Probability) -> bool
Returns a bool with a probability p of being true. Read more
sourcefn next_lim_u16(&mut self, lim: u16) -> u16
fn next_lim_u16(&mut self, lim: u16) -> u16
Generates a random number in 0..lim.
sourcefn next_lim_u32(&mut self, lim: u32) -> u32
fn next_lim_u32(&mut self, lim: u32) -> u32
Generates a random number in 0..lim.
sourcefn next_lim_u64(&mut self, lim: u64) -> u64
fn next_lim_u64(&mut self, lim: u64) -> u64
Generates a random number in 0..lim.
sourcefn next_lim_u128(&mut self, lim: u128) -> u128
fn next_lim_u128(&mut self, lim: u128) -> u128
Generates a random number in 0..lim.
sourcefn next_lim_usize(&mut self, lim: usize) -> usize
fn next_lim_usize(&mut self, lim: usize) -> usize
Generates a random number in 0..lim.
Auto Trait Implementations
impl !RefUnwindSafe for ThreadLocalRand
impl !Send for ThreadLocalRand
impl !Sync for ThreadLocalRand
impl Unpin for ThreadLocalRand
impl !UnwindSafe for ThreadLocalRand
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<R> RandRange<Duration> for Rwhere
R: Rand,
impl<R> RandRange<Duration> for Rwhere
R: Rand,
sourcefn next_range(&mut self, range: Range<Duration>) -> Duration
fn next_range(&mut self, range: Range<Duration>) -> Duration
Generates a random number in the given range.
sourceimpl<R> RandRange<u128> for Rwhere
R: Rand,
impl<R> RandRange<u128> for Rwhere
R: Rand,
sourcefn next_range(&mut self, range: Range<u128>) -> u128
fn next_range(&mut self, range: Range<u128>) -> u128
Generates a random number in the given range.
sourceimpl<R> RandRange<u16> for Rwhere
R: Rand,
impl<R> RandRange<u16> for Rwhere
R: Rand,
sourcefn next_range(&mut self, range: Range<u16>) -> u16
fn next_range(&mut self, range: Range<u16>) -> u16
Generates a random number in the given range.
sourceimpl<R> RandRange<u32> for Rwhere
R: Rand,
impl<R> RandRange<u32> for Rwhere
R: Rand,
sourcefn next_range(&mut self, range: Range<u32>) -> u32
fn next_range(&mut self, range: Range<u32>) -> u32
Generates a random number in the given range.
sourceimpl<R> RandRange<u64> for Rwhere
R: Rand,
impl<R> RandRange<u64> for Rwhere
R: Rand,
sourcefn next_range(&mut self, range: Range<u64>) -> u64
fn next_range(&mut self, range: Range<u64>) -> u64
Generates a random number in the given range.
sourceimpl<R> RandRange<usize> for Rwhere
R: Rand,
impl<R> RandRange<usize> for Rwhere
R: Rand,
sourcefn next_range(&mut self, range: Range<usize>) -> usize
fn next_range(&mut self, range: Range<usize>) -> usize
Generates a random number in the given range.