Crate names[][src]

Expand description

This crate provides a generate that constructs random name strings suitable for use in container instances, project names, application instances, etc.

The name Generator implements the Iterator trait so it can be used with adapters, consumers, and in loops.


This crate is on and can be used by adding names to your dependencies in your project’s Cargo.toml file:

names = { version = "0.12.0", default-features = false }


Example: painless defaults

The easiest way to get started is to use the default Generator to return a name:

use names::Generator;

let mut generator = Generator::default();
println!("Your project is: {}",;
// #=> "Your project is: rusty-nail"

If more randomness is required, you can generate a name with a trailing 4-digit number:

use names::{Generator, Name};

let mut generator = Generator::with_naming(Name::Numbered);
println!("Your project is: {}",;
// #=> "Your project is: pushy-pencil-5602"

Example: with custom dictionaries

If you would rather supply your own custom adjective and noun word lists, you can provide your own by supplying 2 string slices. For example, this returns only one result:

use names::{Generator, Name};

let adjectives = &["imaginary"];
let nouns = &["roll"];
let mut generator = Generator::new(adjectives, nouns, Name::default());



A random name generator which combines an adjective, a noun, and an optional number


A naming strategy for the Generator


List of English adjective words

List of English noun words