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