Struct namegen::Name [−][src]
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]
&mut self,
part_name: &str,
sample_set: &SampleSet
) -> Result<(), LearnError>
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]
&self,
seed: u64,
format_name: &str
) -> Option<GeneratorIter<'_, SmallRng>>
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]
&self,
format_name: &str
) -> Option<GeneratorIter<'_, ThreadRng>>
If you for some reason need a secure random generator....
pub fn validate(&self) -> Result<(), ValidationError>
[src]
pub fn new() -> Name
[src]
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,