[][src]Struct rnglib::RNG

pub struct RNG {
    pub name: String,
    pub prefixes: Syllables,
    pub centers: Syllables,
    pub suffixes: Syllables,
    pub bad_syllables: Vec<String>,
}

RNG (Random Name Generator) is a library that generates random names based upon one of the available Languages.

Usage:

use rnglib::{RNG, Language};

let rng = RNG::new(&Language::Elven).unwrap();

let first_name = rng.generate_name();
let last_name = rng.generate_name();

println!("{}: {} {}", rng.name, first_name, last_name)

Fields

name: Stringprefixes: Syllablescenters: Syllablessuffixes: Syllablesbad_syllables: Vec<String>

Implementations

impl RNG[src]

pub fn new(language: &Language) -> Result<RNG, RNG>[src]

pub fn empty(name: String) -> RNG[src]

pub fn is_empty(&self) -> bool[src]

pub fn is_valid(&self) -> bool[src]

pub fn generate(language: &Language) -> RNG[src]

pub fn generate_name(&self) -> String[src]

pub fn generate_short(&self) -> String[src]

pub fn generate_name_by_count(&self, count: u8) -> String[src]

pub fn generate_syllables(&self) -> Syllables[src]

pub fn generate_syllables_by_count(&self, syllable_count: u8) -> Syllables[src]

pub fn syllables(&self) -> Syllables[src]

Trait Implementations

impl Clone for RNG[src]

impl Debug for RNG[src]

impl PartialEq<RNG> for RNG[src]

impl StructuralPartialEq for RNG[src]

Auto Trait Implementations

impl RefUnwindSafe for RNG

impl Send for RNG

impl Sync for RNG

impl Unpin for RNG

impl UnwindSafe for RNG

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,