pub struct RdRand<'a>(/* private fields */);Implementations§
Source§impl<'a> RdRand<'a>
impl<'a> RdRand<'a>
pub fn new(rng: &'a mut SmallRng) -> Self
pub fn random<T>(&mut self) -> T
pub fn range<T>(&mut self, range: Range<T>) -> Twhere
T: SampleUniform + PartialOrd,
pub fn bool(&mut self, prob: f32) -> bool
pub fn choose<'b, T>(&mut self, items: &'b [T]) -> &'b T
pub fn choose_mut<'b, T>(&mut self, items: &'b mut [T]) -> &'b mut T
pub fn shuffle<T>(&mut self, items: &mut [T])
pub fn gaussian(&mut self, mean: f64, std_dev: f64) -> f64
pub fn shuffled_indices(&mut self, range: Range<usize>) -> Vec<usize>
pub fn sample_indices( &mut self, range: Range<usize>, sample_size: usize, ) -> Vec<usize>
pub fn cond_indices(&mut self, range: Range<usize>, prob: f32) -> Vec<usize>
Auto Trait Implementations§
impl<'a> Freeze for RdRand<'a>
impl<'a> RefUnwindSafe for RdRand<'a>
impl<'a> Send for RdRand<'a>
impl<'a> Sync for RdRand<'a>
impl<'a> Unpin for RdRand<'a>
impl<'a> UnsafeUnpin for RdRand<'a>
impl<'a> !UnwindSafe for RdRand<'a>
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