pub struct RockComposition { /* private fields */ }Implementations§
Source§impl RockComposition
impl RockComposition
Sourcepub fn with_label(label: impl AsRef<str>) -> Result<Self, RockTextError>
pub fn with_label(label: impl AsRef<str>) -> Result<Self, RockTextError>
Creates a rock composition with a non-empty label and no mineral names.
§Errors
Returns RockTextError::Empty when the trimmed label is empty.
Sourcepub fn with_mineral_names<I, S>(
mineral_names: I,
) -> Result<Self, RockCompositionError>
pub fn with_mineral_names<I, S>( mineral_names: I, ) -> Result<Self, RockCompositionError>
Creates a rock composition from at least one non-empty mineral name.
§Errors
Returns RockCompositionError::EmptyMineralName when any mineral name is empty.
Returns RockCompositionError::NoMineralNames when no mineral names are supplied.
Sourcepub fn describe<I, S>(
label: impl AsRef<str>,
mineral_names: I,
) -> Result<Self, RockCompositionError>
pub fn describe<I, S>( label: impl AsRef<str>, mineral_names: I, ) -> Result<Self, RockCompositionError>
Creates a labeled rock composition from a non-empty label and mineral list.
§Errors
Returns RockCompositionError::EmptyLabel when the label is empty.
Returns RockCompositionError::EmptyMineralName when any mineral name is empty.
Returns RockCompositionError::NoMineralNames when no mineral names are supplied.
pub fn label(&self) -> Option<&str>
pub fn mineral_names(&self) -> &[String]
Trait Implementations§
Source§impl Clone for RockComposition
impl Clone for RockComposition
Source§fn clone(&self) -> RockComposition
fn clone(&self) -> RockComposition
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 RockComposition
impl Debug for RockComposition
Source§impl Display for RockComposition
impl Display for RockComposition
Source§impl Hash for RockComposition
impl Hash for RockComposition
Source§impl Ord for RockComposition
impl Ord for RockComposition
Source§fn cmp(&self, other: &RockComposition) -> Ordering
fn cmp(&self, other: &RockComposition) -> 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 RockComposition
impl PartialEq for RockComposition
Source§impl PartialOrd for RockComposition
impl PartialOrd for RockComposition
impl Eq for RockComposition
impl StructuralPartialEq for RockComposition
Auto Trait Implementations§
impl Freeze for RockComposition
impl RefUnwindSafe for RockComposition
impl Send for RockComposition
impl Sync for RockComposition
impl Unpin for RockComposition
impl UnsafeUnpin for RockComposition
impl UnwindSafe for RockComposition
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