[−][src]Struct rand::distributions::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 Distribution<char> for Alphanumeric
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> char
[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,
[src]
ⓘImportant traits for DistIter<'a, D, R, T>
Self: Sized,
R: Rng,
impl Debug for Alphanumeric
[src]
Auto Trait Implementations
impl Send for Alphanumeric
impl Unpin for Alphanumeric
impl Sync for Alphanumeric
impl UnwindSafe for Alphanumeric
impl RefUnwindSafe for Alphanumeric
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,