pub struct ReactionEntry { /* private fields */ }Expand description
A stoichiometric entry on one side of a reaction.
Implementations§
Source§impl ReactionEntry
impl ReactionEntry
Sourcepub fn new(
coefficient: StoichiometricCoefficient,
formula: ChemicalFormula,
side: ReactionSide,
) -> Result<Self, StoichiometryValidationError>
pub fn new( coefficient: StoichiometricCoefficient, formula: ChemicalFormula, side: ReactionSide, ) -> Result<Self, StoichiometryValidationError>
Creates a reaction entry.
§Errors
Returns StoichiometryValidationError::ZeroCoefficient if the coefficient is
structurally invalid.
Sourcepub fn from_value(
coefficient: u32,
formula: ChemicalFormula,
side: ReactionSide,
) -> Result<Self, StoichiometryValidationError>
pub fn from_value( coefficient: u32, formula: ChemicalFormula, side: ReactionSide, ) -> Result<Self, StoichiometryValidationError>
Creates a reaction entry from a raw coefficient value.
§Errors
Returns StoichiometryValidationError::ZeroCoefficient when coefficient is zero.
Sourcepub const fn coefficient(&self) -> StoichiometricCoefficient
pub const fn coefficient(&self) -> StoichiometricCoefficient
Returns the coefficient.
Sourcepub const fn side(&self) -> ReactionSide
pub const fn side(&self) -> ReactionSide
Returns the reaction side.
Sourcepub const fn term(&self) -> &StoichiometricTerm
pub const fn term(&self) -> &StoichiometricTerm
Returns the stoichiometric term.
Sourcepub fn into_parts(
self,
) -> (StoichiometricCoefficient, ChemicalFormula, ReactionSide)
pub fn into_parts( self, ) -> (StoichiometricCoefficient, ChemicalFormula, ReactionSide)
Consumes the entry and returns its parts.
Trait Implementations§
Source§impl Clone for ReactionEntry
impl Clone for ReactionEntry
Source§fn clone(&self) -> ReactionEntry
fn clone(&self) -> ReactionEntry
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 ReactionEntry
impl Debug for ReactionEntry
Source§impl Display for ReactionEntry
impl Display for ReactionEntry
Source§impl PartialEq for ReactionEntry
impl PartialEq for ReactionEntry
impl Eq for ReactionEntry
impl StructuralPartialEq for ReactionEntry
Auto Trait Implementations§
impl Freeze for ReactionEntry
impl RefUnwindSafe for ReactionEntry
impl Send for ReactionEntry
impl Sync for ReactionEntry
impl Unpin for ReactionEntry
impl UnsafeUnpin for ReactionEntry
impl UnwindSafe for ReactionEntry
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