Struct armnod::CharSetChooser
source · pub struct CharSetChooser { /* private fields */ }Expand description
Choose characters from alphabets of up to 96 characters.
Implementations§
source§impl CharSetChooser
impl CharSetChooser
sourcepub fn new(s: &str) -> Self
pub fn new(s: &str) -> Self
Create a new CharSetChooser that will select characters from s uniformly at random.
Trait Implementations§
source§impl CharacterChooser for CharSetChooser
impl CharacterChooser for CharSetChooser
source§fn which_char(&mut self, guac: &mut Guacamole) -> char
fn which_char(&mut self, guac: &mut Guacamole) -> char
Generate a single char according to the distribution, using
guac.source§fn whole_string(&mut self, bytes: &mut [u8]) -> String
fn whole_string(&mut self, bytes: &mut [u8]) -> String
Generate a string equal in length to
bytes, using each character of bytes as a random
value to pick another character. NOTE(rescrv): This implies the CharacterChooser API
only supports 256 distinct characters at a time, and I’m OK with that.Auto Trait Implementations§
impl RefUnwindSafe for CharSetChooser
impl Send for CharSetChooser
impl Sync for CharSetChooser
impl Unpin for CharSetChooser
impl UnwindSafe for CharSetChooser
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