Struct petname::Petnames [] [src]

pub struct Petnames<'a> {
    pub adjectives: Vec<&'a str>,
    pub adverbs: Vec<&'a str>,
    pub names: Vec<&'a str>,
}

Word lists and the logic to combine them into petnames.

A petname with n words will contain, in order:

  • 1 adjective when n >= 2, otherwise 0 adjectives.
  • n - 2 adverbs when n >= 2.
  • 1 name / noun.

Fields

Methods

impl<'a> Petnames<'a>
[src]

Constructs a new Petnames with default word lists.

Generate a new petname.

Examples

let mut rng = rand::thread_rng();
petname::Petnames::default().generate(&mut rng, 7, ":");