pub struct PrefixedIdGenerator { /* private fields */ }Expand description
Generates prefix<separator><random> ids from a fixed alphabet.
Implementations§
Source§impl PrefixedIdGenerator
impl PrefixedIdGenerator
Sourcepub fn new(prefix: impl Into<String>, size: usize) -> PrefixedIdGenerator
pub fn new(prefix: impl Into<String>, size: usize) -> PrefixedIdGenerator
Ids of the form prefix-<size random characters>.
Sourcepub fn unprefixed(size: usize) -> PrefixedIdGenerator
pub fn unprefixed(size: usize) -> PrefixedIdGenerator
Ids without a prefix.
Sourcepub fn with_separator(self, separator: char) -> PrefixedIdGenerator
pub fn with_separator(self, separator: char) -> PrefixedIdGenerator
Changes the separator between prefix and random part.
Trait Implementations§
Source§impl Clone for PrefixedIdGenerator
impl Clone for PrefixedIdGenerator
Source§fn clone(&self) -> PrefixedIdGenerator
fn clone(&self) -> PrefixedIdGenerator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrefixedIdGenerator
impl Debug for PrefixedIdGenerator
Source§impl Default for PrefixedIdGenerator
impl Default for PrefixedIdGenerator
Source§fn default() -> PrefixedIdGenerator
fn default() -> PrefixedIdGenerator
Returns the “default value” for a type. Read more
Source§impl IdGenerator for PrefixedIdGenerator
impl IdGenerator for PrefixedIdGenerator
Auto Trait Implementations§
impl Freeze for PrefixedIdGenerator
impl RefUnwindSafe for PrefixedIdGenerator
impl Send for PrefixedIdGenerator
impl Sync for PrefixedIdGenerator
impl Unpin for PrefixedIdGenerator
impl UnsafeUnpin for PrefixedIdGenerator
impl UnwindSafe for PrefixedIdGenerator
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