names

Function rand_lowercase_with

Source
pub fn rand_lowercase_with(rng: &mut (impl ?Sized + Rng)) -> &'static str
Expand description

Selects a random name out of *all* available lowercase names using a provided Random Number Generator (RNG).

Note that this dependent on which features are given. For example, if only the three-feature is given, this will only return three-letter names.

§Arguments

  • rng: The random number generator (as an [Rng]) to use.

§Returns

A &'static str that refers to a random constant in this crate.

§Example

use names::rand_lowercase_with;
use rand::thread_rng;

// Could print any of the `amy`, `bob`, `cho`, ... names!
println!("{}", rand_lowercase_with(&mut thread_rng()));