pub struct Alphanumeric<T = String>(/* private fields */);Expand description
A string that is known to contain only alphanumeric characters
Implementations§
Source§impl<T> Alphanumeric<T>
impl<T> Alphanumeric<T>
Sourcepub fn new(value: T) -> Option<Self>
pub fn new(value: T) -> Option<Self>
Creates a new Alphanumeric string if the string is
only alphanumeric characters
Sourcepub unsafe fn new_unchecked(value: T) -> Self
pub unsafe fn new_unchecked(value: T) -> Self
Creates a new Alphanumeric without checking the value.
§Safety
The value must be only alphanumeric characters
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Returns the inner value
Trait Implementations§
Source§impl<T> AsRef<str> for Alphanumeric<T>
impl<T> AsRef<str> for Alphanumeric<T>
Source§impl<T: Clone> Clone for Alphanumeric<T>
impl<T: Clone> Clone for Alphanumeric<T>
Source§fn clone(&self) -> Alphanumeric<T>
fn clone(&self) -> Alphanumeric<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for Alphanumeric<T>
impl<T: Debug> Debug for Alphanumeric<T>
Source§impl<T> Deref for Alphanumeric<T>
impl<T> Deref for Alphanumeric<T>
Source§impl<T> Display for Alphanumeric<T>where
T: Display,
impl<T> Display for Alphanumeric<T>where
T: Display,
Source§impl<T> From<Alphanumeric<T>> for String
impl<T> From<Alphanumeric<T>> for String
Source§fn from(value: Alphanumeric<T>) -> Self
fn from(value: Alphanumeric<T>) -> Self
Converts to this type from the input type.
Source§impl<T: Hash> Hash for Alphanumeric<T>
impl<T: Hash> Hash for Alphanumeric<T>
Source§impl<T: Ord> Ord for Alphanumeric<T>
impl<T: Ord> Ord for Alphanumeric<T>
Source§fn cmp(&self, other: &Alphanumeric<T>) -> Ordering
fn cmp(&self, other: &Alphanumeric<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for Alphanumeric<T>
impl<T: PartialEq> PartialEq for Alphanumeric<T>
Source§impl<T: PartialOrd> PartialOrd for Alphanumeric<T>
impl<T: PartialOrd> PartialOrd for Alphanumeric<T>
Source§impl<T, Z> Strip for Alphanumeric<T>
impl<T, Z> Strip for Alphanumeric<T>
impl<T: Eq> Eq for Alphanumeric<T>
impl<T> StructuralPartialEq for Alphanumeric<T>
Auto Trait Implementations§
impl<T> Freeze for Alphanumeric<T>where
T: Freeze,
impl<T> RefUnwindSafe for Alphanumeric<T>where
T: RefUnwindSafe,
impl<T> Send for Alphanumeric<T>where
T: Send,
impl<T> Sync for Alphanumeric<T>where
T: Sync,
impl<T> Unpin for Alphanumeric<T>where
T: Unpin,
impl<T> UnwindSafe for Alphanumeric<T>where
T: UnwindSafe,
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