pub struct TextGenerator { /* private fields */ }Expand description
Generator for Unicode text strings. Created by text().
Implementations§
Source§impl TextGenerator
impl TextGenerator
Sourcepub fn alphabet(self, chars: &str) -> Self
pub fn alphabet(self, chars: &str) -> Self
Use a fixed set of characters. Each character in the generated string will be a member of the alphabet.
Mutually exclusive with the character filtering methods like codec,
categories, min_codepoint, etc.
Sourcepub fn codec(self, codec: &str) -> Self
pub fn codec(self, codec: &str) -> Self
Restrict to characters encodable in this codec (e.g. "ascii", "utf-8", "latin-1").
Sourcepub fn min_codepoint(self, min_codepoint: u32) -> Self
pub fn min_codepoint(self, min_codepoint: u32) -> Self
Set the minimum Unicode codepoint.
Sourcepub fn max_codepoint(self, max_codepoint: u32) -> Self
pub fn max_codepoint(self, max_codepoint: u32) -> Self
Set the maximum Unicode codepoint.
Sourcepub fn categories(self, categories: &[&str]) -> Self
pub fn categories(self, categories: &[&str]) -> Self
Include only characters from these Unicode general categories (e.g. ["L", "Nd"]).
Mutually exclusive with exclude_categories.
Sourcepub fn exclude_categories(self, exclude_categories: &[&str]) -> Self
pub fn exclude_categories(self, exclude_categories: &[&str]) -> Self
Exclude characters from these Unicode general categories.
Mutually exclusive with categories.
Sourcepub fn include_characters(self, include_characters: &str) -> Self
pub fn include_characters(self, include_characters: &str) -> Self
Always include these specific characters, even if excluded by other filters.
Sourcepub fn exclude_characters(self, exclude_characters: &str) -> Self
pub fn exclude_characters(self, exclude_characters: &str) -> Self
Always exclude these specific characters.
Trait Implementations§
Source§impl Generator<String> for TextGenerator
impl Generator<String> for TextGenerator
Source§fn map<U, F>(self, f: F) -> Mapped<T, U, F, Self>
fn map<U, F>(self, f: F) -> Mapped<T, U, F, Self>
Transform generated values using a function. Read more
Source§fn flat_map<U, G, F>(self, f: F) -> FlatMapped<T, U, G, F, Self>
fn flat_map<U, G, F>(self, f: F) -> FlatMapped<T, U, G, F, Self>
Generate a value, then use it to choose or configure another generator. Read more
Auto Trait Implementations§
impl Freeze for TextGenerator
impl RefUnwindSafe for TextGenerator
impl Send for TextGenerator
impl Sync for TextGenerator
impl Unpin for TextGenerator
impl UnsafeUnpin for TextGenerator
impl UnwindSafe for TextGenerator
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