pub struct RandomString { /* private fields */ }Expand description
Generates an alphanumeric string from entropy bytes.
The output length defaults to 16 characters but can be configured.
Characters are drawn from [a-zA-Z0-9].
Implementations§
Source§impl RandomString
impl RandomString
Sourcepub fn with_length(len: usize) -> Self
pub fn with_length(len: usize) -> Self
Create with a specific output length (clamped to 1..=64).
Trait Implementations§
Source§impl Default for RandomString
impl Default for RandomString
Auto Trait Implementations§
impl Freeze for RandomString
impl RefUnwindSafe for RandomString
impl Send for RandomString
impl Sync for RandomString
impl Unpin for RandomString
impl UnsafeUnpin for RandomString
impl UnwindSafe for RandomString
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more