Struct rand::distributions::Alphanumeric [−][src]
pub struct Alphanumeric;
Sample a char
, uniformly distributed over ASCII letters and numbers:
a-z, A-Z and 0-9.
Example
use std::iter; use rand::{Rng, thread_rng}; use rand::distributions::Alphanumeric; let mut rng = thread_rng(); let chars: String = iter::repeat(()) .map(|()| rng.sample(Alphanumeric)) .take(7) .collect(); println!("Random chars: {}", chars);
Trait Implementations
impl Debug for Alphanumeric
[src]
impl Debug for Alphanumeric
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Distribution<char> for Alphanumeric
[src]
impl Distribution<char> for Alphanumeric
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> char
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> char
Generate a random value of T
, using rng
as the source of randomness.
ⓘImportant traits for DistIter<'a, D, R, T>fn sample_iter<'a, R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
Self: Sized,
R: Rng,
[src]
ⓘImportant traits for DistIter<'a, D, R, T>
fn sample_iter<'a, R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
Self: Sized,
R: Rng,
Create an iterator that generates random values of T
, using rng
as the source of randomness. Read more
Auto Trait Implementations
impl Send for Alphanumeric
impl Send for Alphanumeric
impl Sync for Alphanumeric
impl Sync for Alphanumeric