pub struct Random { /* private fields */ }
Expand description
The main RNG data structure.
Implementations§
Source§impl Random
impl Random
Sourcepub fn gen<T>(&self) -> Twhere
Standard: Distribution<T>,
pub fn gen<T>(&self) -> Twhere
Standard: Distribution<T>,
Function that delegates to rand::Rng::gen()
Sourcepub fn bytes(&self, length: usize) -> Vec<u8> ⓘ
pub fn bytes(&self, length: usize) -> Vec<u8> ⓘ
Utility function to generate a new Vec of bytes.
Sourcepub fn alphanumeric(&self, length: usize) -> String
pub fn alphanumeric(&self, length: usize) -> String
Utility function to generate a new String consisting only of numbers and letters.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Random
impl !RefUnwindSafe for Random
impl Send for Random
impl Sync for Random
impl Unpin for Random
impl !UnwindSafe for Random
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