Crate salps

Crate salps 

Source
Expand description

random string generation.

salps provides a minimal api for creating silly randomly generated strings of not particularly high quality.

§usage

use core::fmt::Write;
 
// first bring a type that implements `core::fmt::Write`
let mut string = String::new();
 
// then bring an rng generator (you will probably have
// to implement this crate's `Random` trait yourself)
let mut rng = Rng::new();
 
// and finally, create a configuration, or use the default:
let config = salps::Config::new();
 
// now generate a word!
salps::word(&mut string, &mut rng, &config)?;

Structs§

Config
configuration for this crate.

Constants§

DEFAULT_END
default configuration used in Config.
DEFAULT_END_FALLBACK
default configuration used in Config.
DEFAULT_MID
default configuration used in Config.
DEFAULT_MID_FALLBACK
default configuration used in Config.

Traits§

Random
trait for providing random numbers.

Functions§

paragraph
generates sentences to form a paragraph.
sentence
generates words to form a sentence.
word
generates a word.