Struct CommonName
pub struct CommonName(/* private fields */);Expand description
A non-empty common name.
Implementations§
§impl CommonName
impl CommonName
pub fn new(value: impl AsRef<str>) -> Result<CommonName, TaxonomyNameError>
pub fn new(value: impl AsRef<str>) -> Result<CommonName, 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.
pub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the name and returns the owned string.
Trait Implementations§
§impl AsRef<str> for CommonName
impl AsRef<str> for CommonName
§impl Clone for CommonName
impl Clone for CommonName
§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 more§impl Debug for CommonName
impl Debug for CommonName
§impl Display for CommonName
impl Display for CommonName
§impl FromStr for CommonName
impl FromStr for CommonName
§type Err = TaxonomyNameError
type Err = TaxonomyNameError
The associated error which can be returned from parsing.
§fn from_str(value: &str) -> Result<CommonName, <CommonName as FromStr>::Err>
fn from_str(value: &str) -> Result<CommonName, <CommonName as FromStr>::Err>
Parses a string
s to return a value of this type. Read more§impl Hash for CommonName
impl Hash for CommonName
§impl Ord for CommonName
impl Ord for CommonName
§impl PartialEq for CommonName
impl PartialEq for CommonName
§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