pub struct ScientificName(/* private fields */);Expand description
A non-empty scientific name.
Implementations§
Source§impl ScientificName
impl ScientificName
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, TaxonomyNameError>
pub fn new(value: impl AsRef<str>) -> Result<Self, 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.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the name and returns the owned string.
Trait Implementations§
Source§impl AsRef<str> for ScientificName
impl AsRef<str> for ScientificName
Source§impl Clone for ScientificName
impl Clone for ScientificName
Source§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 moreSource§impl Debug for ScientificName
impl Debug for ScientificName
Source§impl Display for ScientificName
impl Display for ScientificName
Source§impl FromStr for ScientificName
impl FromStr for ScientificName
Source§impl Hash for ScientificName
impl Hash for ScientificName
Source§impl Ord for ScientificName
impl Ord for ScientificName
Source§fn cmp(&self, other: &ScientificName) -> Ordering
fn cmp(&self, other: &ScientificName) -> 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 ScientificName
impl PartialEq for ScientificName
Source§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