pub struct CompoundName(/* private fields */);Expand description
A validated primary compound name.
Implementations§
Source§impl CompoundName
impl CompoundName
Sourcepub fn new(name: &str) -> Result<Self, CompoundValidationError>
pub fn new(name: &str) -> Result<Self, CompoundValidationError>
Creates a compound name.
§Errors
Returns CompoundValidationError::EmptyName 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 CompoundName
impl AsRef<str> for CompoundName
Source§impl Clone for CompoundName
impl Clone for CompoundName
Source§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 moreSource§impl Debug for CompoundName
impl Debug for CompoundName
Source§impl Display for CompoundName
impl Display for CompoundName
Source§impl Hash for CompoundName
impl Hash for CompoundName
Source§impl Ord for CompoundName
impl Ord for CompoundName
Source§fn cmp(&self, other: &CompoundName) -> Ordering
fn cmp(&self, other: &CompoundName) -> 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 CompoundName
impl PartialEq for CompoundName
Source§impl PartialOrd for CompoundName
impl PartialOrd for CompoundName
Source§impl TryFrom<&str> for CompoundName
impl TryFrom<&str> for CompoundName
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