pub struct MassContributionSet { /* private fields */ }Expand description
Ordered per-element molar-mass contributions.
Implementations§
Source§impl MassContributionSet
impl MassContributionSet
Sourcepub fn from_contributions(
contributions: impl IntoIterator<Item = ElementMassContribution>,
) -> Self
pub fn from_contributions( contributions: impl IntoIterator<Item = ElementMassContribution>, ) -> Self
Creates a contribution set from validated contributions.
Sourcepub fn push(&mut self, contribution: ElementMassContribution)
pub fn push(&mut self, contribution: ElementMassContribution)
Appends a contribution.
Sourcepub fn as_slice(&self) -> &[ElementMassContribution]
pub fn as_slice(&self) -> &[ElementMassContribution]
Returns the contributions as a slice.
Sourcepub fn iter(&self) -> impl Iterator<Item = &ElementMassContribution>
pub fn iter(&self) -> impl Iterator<Item = &ElementMassContribution>
Iterates over contributions in stored order.
Sourcepub fn total_mass_value(&self) -> f64
pub fn total_mass_value(&self) -> f64
Returns the total molar-mass value in grams per mole.
Sourcepub fn molar_mass(&self) -> Result<MolarMass, MolarMassValidationError>
pub fn molar_mass(&self) -> Result<MolarMass, MolarMassValidationError>
Returns the total as a molar mass value in grams per mole.
§Errors
Returns a molar-mass validation error if the total is not finite and positive.
Trait Implementations§
Source§impl Clone for MassContributionSet
impl Clone for MassContributionSet
Source§fn clone(&self) -> MassContributionSet
fn clone(&self) -> MassContributionSet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MassContributionSet
impl Debug for MassContributionSet
Source§impl Default for MassContributionSet
impl Default for MassContributionSet
Source§fn default() -> MassContributionSet
fn default() -> MassContributionSet
Returns the “default value” for a type. Read more
Source§impl Display for MassContributionSet
impl Display for MassContributionSet
Source§impl PartialEq for MassContributionSet
impl PartialEq for MassContributionSet
Source§fn eq(&self, other: &MassContributionSet) -> bool
fn eq(&self, other: &MassContributionSet) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MassContributionSet
Auto Trait Implementations§
impl Freeze for MassContributionSet
impl RefUnwindSafe for MassContributionSet
impl Send for MassContributionSet
impl Sync for MassContributionSet
impl Unpin for MassContributionSet
impl UnsafeUnpin for MassContributionSet
impl UnwindSafe for MassContributionSet
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