Struct CompoundName
pub struct CompoundName(/* private fields */);Expand description
A validated primary compound name.
Implementations§
§impl CompoundName
impl CompoundName
pub fn new(name: &str) -> Result<CompoundName, CompoundValidationError>
pub fn new(name: &str) -> Result<CompoundName, CompoundValidationError>
Creates a compound name.
§Errors
Returns CompoundValidationError::EmptyName 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 CompoundName
impl AsRef<str> for CompoundName
§impl Clone for CompoundName
impl Clone for CompoundName
§fn clone(&self) -> CompoundName
fn clone(&self) -> CompoundName
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 CompoundName
impl Debug for CompoundName
§impl Display for CompoundName
impl Display for CompoundName
§impl Hash for CompoundName
impl Hash for CompoundName
§impl Ord for CompoundName
impl Ord for CompoundName
§impl PartialEq for CompoundName
impl PartialEq for CompoundName
§impl PartialOrd for CompoundName
impl PartialOrd for CompoundName
§impl TryFrom<&str> for CompoundName
impl TryFrom<&str> for CompoundName
§type Error = CompoundValidationError
type Error = CompoundValidationError
The type returned in the event of a conversion error.
§fn try_from(
value: &str,
) -> Result<CompoundName, <CompoundName as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<CompoundName, <CompoundName as TryFrom<&str>>::Error>
Performs the conversion.
impl Eq for CompoundName
impl StructuralPartialEq for CompoundName
Auto Trait Implementations§
impl Freeze for CompoundName
impl RefUnwindSafe for CompoundName
impl Send for CompoundName
impl Sync for CompoundName
impl Unpin for CompoundName
impl UnsafeUnpin for CompoundName
impl UnwindSafe for CompoundName
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