Struct qwerty::diceware::diceware_distribution::Diceware [−][src]
pub struct Diceware;
Sample a word, uniformly distributed over the standard diceware list:
The complete list contains 7776 short words, abbreviations and easy-to-remember character strings. The average length of each word is about 4.2 characters. The biggest words are six characters long.
Example
use std::iter; use rand::{Rng, thread_rng}; use qwerty::diceware::Diceware; let mut rng = thread_rng(); let words: Vec<&'static [u8]> = iter::repeat(()) .map(|()| rng.sample(Diceware)) .take(7) .collect(); println!("Random words: {:?}", words);
Trait Implementations
impl Debug for Diceware
[src]
impl Debug for Diceware
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<&'static [u8]> for Diceware
[src]
impl Distribution<&'static [u8]> for Diceware
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> &'static [u8]
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> &'static [u8]
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
R: Rng,
[src]
fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
R: Rng,
Create an iterator that generates random values of T
, using rng
as the source of randomness. Read more