Struct namegen::Name[][src]

pub struct Name { /* fields omitted */ }

Implementations

impl Name[src]

pub fn add_part(&mut self, part: NamePart)[src]

pub fn learn(
    &mut self,
    part_name: &str,
    sample_set: &SampleSet
) -> Result<(), LearnError>
[src]

pub fn add_format(&mut self, name: &str, str: &str)[src]

pub fn generate(&self, format_name: &str) -> Option<GeneratorIter<'_, SmallRng>>[src]

Generate names with a fast RNG (SmallRng). This uses thread_rng() to seed, and may return none.

pub fn first_format_name(&self) -> Option<&str>[src]

Get the first format name. Will return None if no formats exist.

pub fn parts(&self) -> impl Iterator<Item = &NamePart>[src]

Iterate over the parts.

pub fn formats(&self) -> impl Iterator<Item = &NameFormat>[src]

Iterate over the formats.

pub fn has_part_name(&self, name: &str) -> bool[src]

Check if the generator has the requested part name.

pub fn has_format_name(&self, name: &str) -> bool[src]

Check if the generator has the requested format name.

pub fn generate_seeded(
    &self,
    seed: u64,
    format_name: &str
) -> Option<GeneratorIter<'_, SmallRng>>
[src]

Generate names with a fast RNG (SmallRng) using a seed. This is useful if your rand version differs and you want it to be dependent on external reproducable random data (e.g. if namegen is part of a bigger procedural generation pipeline).

pub fn generate_with_thread_rng(
    &self,
    format_name: &str
) -> Option<GeneratorIter<'_, ThreadRng>>
[src]

If you for some reason need a secure random generator....

pub fn validate(&self) -> Result<(), ValidationError>[src]

pub fn new() -> Name[src]

Trait Implementations

impl Clone for Name[src]

Auto Trait Implementations

impl RefUnwindSafe for Name

impl Send for Name

impl Sync for Name

impl Unpin for Name

impl UnwindSafe for Name

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>,