pub struct Surrogate<'a, 'd> { /* private fields */ }Expand description
Encapsulates the state of the mock and a reference to the next_u128 delegate, so
that it can be invoked from inside the mock by, for example, another delegate.
Implementations§
Trait Implementations§
Source§impl<'a, 'd> Rand for Surrogate<'a, 'd>
impl<'a, 'd> Rand for Surrogate<'a, 'd>
Source§fn next_usize(&mut self) -> usize
fn next_usize(&mut self) -> usize
Returns the next random
usize.Source§fn next_bool(&mut self, p: Probability) -> bool
fn next_bool(&mut self, p: Probability) -> bool
Source§fn next_lim_u16(&mut self, lim: u16) -> u16
fn next_lim_u16(&mut self, lim: u16) -> u16
Generates a random number in
0..lim.Source§fn next_lim_u32(&mut self, lim: u32) -> u32
fn next_lim_u32(&mut self, lim: u32) -> u32
Generates a random number in
0..lim.Source§fn next_lim_u64(&mut self, lim: u64) -> u64
fn next_lim_u64(&mut self, lim: u64) -> u64
Generates a random number in
0..lim.Source§fn next_lim_u128(&mut self, lim: u128) -> u128
fn next_lim_u128(&mut self, lim: u128) -> u128
Generates a random number in
0..lim.Source§fn 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<'a, 'd> Freeze for Surrogate<'a, 'd>
impl<'a, 'd> !RefUnwindSafe for Surrogate<'a, 'd>
impl<'a, 'd> !Send for Surrogate<'a, 'd>
impl<'a, 'd> !Sync for Surrogate<'a, 'd>
impl<'a, 'd> Unpin for Surrogate<'a, 'd>
impl<'a, 'd> UnsafeUnpin for Surrogate<'a, 'd>
impl<'a, 'd> !UnwindSafe for Surrogate<'a, 'd>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more