pub struct CommonName(/* private fields */);Expand description
A non-empty common name.
Implementations§
Source§impl CommonName
impl CommonName
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, TaxonomyNameError>
pub fn new(value: impl AsRef<str>) -> Result<Self, TaxonomyNameError>
Creates a common name from non-empty text.
Surrounding whitespace is trimmed; the remaining text and casing are preserved.
§Errors
Returns TaxonomyNameError::Empty when the trimmed name is empty.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the name and returns the owned string.
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 FromStr for CommonName
impl FromStr 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
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