pub struct PercentYield(/* private fields */);Expand description
A nonnegative finite percent yield value.
Implementations§
Source§impl PercentYield
impl PercentYield
Sourcepub fn new(value: f64) -> Result<Self, StoichiometryValidationError>
pub fn new(value: f64) -> Result<Self, StoichiometryValidationError>
Creates a percent yield value.
§Errors
Returns StoichiometryValidationError::NonFiniteYield when value is not
finite, or StoichiometryValidationError::NegativeYield when it is negative.
Sourcepub fn from_actual_and_theoretical(
actual: f64,
theoretical: f64,
) -> Result<Self, StoichiometryValidationError>
pub fn from_actual_and_theoretical( actual: f64, theoretical: f64, ) -> Result<Self, StoichiometryValidationError>
Calculates percent yield from actual and theoretical yield values.
§Errors
Returns a validation error when either yield value is invalid, or when the theoretical yield is zero or negative.
Sourcepub fn from_yields(
actual: ActualYield,
theoretical: TheoreticalYield,
) -> Result<Self, StoichiometryValidationError>
pub fn from_yields( actual: ActualYield, theoretical: TheoreticalYield, ) -> Result<Self, StoichiometryValidationError>
Calculates percent yield from validated yield wrappers.
§Errors
Returns StoichiometryValidationError::NonFiniteYield if the calculated percent
yield is not finite.
Trait Implementations§
Source§impl Clone for PercentYield
impl Clone for PercentYield
Source§fn clone(&self) -> PercentYield
fn clone(&self) -> PercentYield
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 PercentYield
impl Debug for PercentYield
Source§impl Display for PercentYield
impl Display for PercentYield
Source§impl PartialEq for PercentYield
impl PartialEq for PercentYield
Source§impl PartialOrd for PercentYield
impl PartialOrd for PercentYield
impl Copy for PercentYield
impl StructuralPartialEq for PercentYield
Auto Trait Implementations§
impl Freeze for PercentYield
impl RefUnwindSafe for PercentYield
impl Send for PercentYield
impl Sync for PercentYield
impl Unpin for PercentYield
impl UnsafeUnpin for PercentYield
impl UnwindSafe for PercentYield
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