Struct CommonName
pub struct CommonName(/* private fields */);Expand description
A validated common compound name.
Implementations§
§impl CommonName
impl CommonName
pub fn new(name: &str) -> Result<CommonName, CompoundValidationError>
pub fn new(name: &str) -> Result<CommonName, CompoundValidationError>
Creates a common name.
§Errors
Returns CompoundValidationError::EmptyCommonName when name is empty after trimming.
pub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the name and returns the owned text.
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 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 TryFrom<&str> for CommonName
impl TryFrom<&str> for CommonName
§type Error = CompoundValidationError
type Error = CompoundValidationError
The type returned in the event of a conversion error.
§fn try_from(
value: &str,
) -> Result<CommonName, <CommonName as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<CommonName, <CommonName as TryFrom<&str>>::Error>
Performs the conversion.
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