Struct ScientificName
pub struct ScientificName(/* private fields */);Expand description
A non-empty scientific name.
Implementations§
§impl ScientificName
impl ScientificName
pub fn new(value: impl AsRef<str>) -> Result<ScientificName, TaxonomyNameError>
pub fn new(value: impl AsRef<str>) -> Result<ScientificName, TaxonomyNameError>
Creates a scientific 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 ScientificName
impl AsRef<str> for ScientificName
§impl Clone for ScientificName
impl Clone for ScientificName
§fn clone(&self) -> ScientificName
fn clone(&self) -> ScientificName
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 ScientificName
impl Debug for ScientificName
§impl Display for ScientificName
impl Display for ScientificName
§impl FromStr for ScientificName
impl FromStr for ScientificName
§type Err = TaxonomyNameError
type Err = TaxonomyNameError
The associated error which can be returned from parsing.
§fn from_str(
value: &str,
) -> Result<ScientificName, <ScientificName as FromStr>::Err>
fn from_str( value: &str, ) -> Result<ScientificName, <ScientificName as FromStr>::Err>
Parses a string
s to return a value of this type. Read more§impl Hash for ScientificName
impl Hash for ScientificName
§impl Ord for ScientificName
impl Ord for ScientificName
§impl PartialEq for ScientificName
impl PartialEq for ScientificName
§impl PartialOrd for ScientificName
impl PartialOrd for ScientificName
impl Eq for ScientificName
impl StructuralPartialEq for ScientificName
Auto Trait Implementations§
impl Freeze for ScientificName
impl RefUnwindSafe for ScientificName
impl Send for ScientificName
impl Sync for ScientificName
impl Unpin for ScientificName
impl UnsafeUnpin for ScientificName
impl UnwindSafe for ScientificName
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