pub struct Words { /* private fields */ }Implementations§
Source§impl Words
impl Words
pub fn new<S: AsRef<str>>( specs: &[PoolSpec], avoid_results: impl IntoIterator<Item = S>, ) -> Result<Self, WordsError>
pub fn names(&self) -> impl Iterator<Item = &str>
pub fn has_pool(&self, pool: &str) -> bool
pub fn capacity(&self, pool: &str) -> Option<u64>
pub fn generate( &self, pool: &str, rng: &Rng, request: u64, ) -> Result<String, WordsError>
pub fn generate_with( &self, pool: &str, rng: &Rng, request: u64, context: &[(&str, &str)], ) -> Result<String, WordsError>
pub fn cast( &self, pool: &str, rng: &Rng, count: usize, ) -> Result<Vec<String>, WordsError>
pub fn cast_distinct<S: AsRef<str>>( &self, pool: &str, rng: &Rng, count: usize, distinct: &[S], ) -> Result<Cast, WordsError>
pub fn redraw<'a>( &self, cast: &'a mut Cast, rng: &Rng, index: usize, counter: u64, ) -> Result<&'a str, WordsError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Words
impl RefUnwindSafe for Words
impl Send for Words
impl Sync for Words
impl Unpin for Words
impl UnsafeUnpin for Words
impl UnwindSafe for Words
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more