Struct namegen::WorkingSet[][src]

pub struct WorkingSet {
    pub result: Vec<usize>,
    pub result_str: String,
    pub result_chars: Vec<char>,
    pub result_total: String,
    pub stack: Vec<usize>,
    pub stack_pos: Vec<usize>,
    pub stack_weight: Vec<usize>,
    pub subtokens: Vec<usize>,
}

A WorkingSet is a crucial part of this generator's performance. It is all local state required to generate a name and get the output without performing additional allocations per generation once the WorkingSet's underlying vectors have grown.

This also means that if you have a working set per thread, then generating names is completely thread safe.

WARNING: While the fields are public, they're not guaranteed in any way. You should always use WorkingSet::new() to create new working sets.

Fields

result: Vec<usize>result_str: Stringresult_chars: Vec<char>result_total: Stringstack: Vec<usize>stack_pos: Vec<usize>stack_weight: Vec<usize>subtokens: Vec<usize>

Implementations

impl WorkingSet[src]

pub fn get_result(&self) -> &str[src]

Get the results from the last generator call. If you need to keep it around, copy it to another string.

pub fn new() -> WorkingSet[src]

Auto Trait Implementations

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