pub struct CommonName(/* private fields */);Expand description
A validated common compound name.
Implementations§
Source§impl CommonName
impl CommonName
Sourcepub fn new(name: &str) -> Result<Self, CompoundValidationError>
pub fn new(name: &str) -> Result<Self, CompoundValidationError>
Creates a common name.
§Errors
Returns CompoundValidationError::EmptyCommonName when name is empty after trimming.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the name and returns the owned text.
Trait Implementations§
Source§impl AsRef<str> for CommonName
impl AsRef<str> for CommonName
Source§impl Clone for CommonName
impl Clone for CommonName
Source§fn clone(&self) -> CommonName
fn clone(&self) -> CommonName
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 Debug for CommonName
impl Debug for CommonName
Source§impl Display for CommonName
impl Display for CommonName
Source§impl Hash for CommonName
impl Hash for CommonName
Source§impl Ord for CommonName
impl Ord for CommonName
Source§fn cmp(&self, other: &CommonName) -> Ordering
fn cmp(&self, other: &CommonName) -> 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 PartialEq for CommonName
impl PartialEq for CommonName
Source§impl PartialOrd for CommonName
impl PartialOrd for CommonName
Source§impl TryFrom<&str> for CommonName
impl TryFrom<&str> for CommonName
impl Eq for CommonName
impl StructuralPartialEq for CommonName
Auto Trait Implementations§
impl Freeze for CommonName
impl RefUnwindSafe for CommonName
impl Send for CommonName
impl Sync for CommonName
impl Unpin for CommonName
impl UnsafeUnpin for CommonName
impl UnwindSafe for CommonName
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