pub struct ReactionEquation { /* private fields */ }Expand description
A chemical reaction equation with reactants, products, and an arrow.
Implementations§
Source§impl ReactionEquation
impl ReactionEquation
Sourcepub fn with_reactant<T>(self, reactant: T) -> Self
pub fn with_reactant<T>(self, reactant: T) -> Self
Adds a reactant and returns the updated equation.
Sourcepub fn with_product<T>(self, product: T) -> Self
pub fn with_product<T>(self, product: T) -> Self
Adds a product and returns the updated equation.
Sourcepub const fn with_arrow(self, arrow: ReactionArrow) -> Self
pub const fn with_arrow(self, arrow: ReactionArrow) -> Self
Sets the reaction arrow.
Sourcepub const fn arrow(&self) -> ReactionArrow
pub const fn arrow(&self) -> ReactionArrow
Returns the reaction arrow.
Sourcepub fn validate(&self) -> Result<(), ReactionValidationError>
pub fn validate(&self) -> Result<(), ReactionValidationError>
Validates that the equation has at least one reactant and one product.
§Errors
Returns ReactionValidationError::EmptyReaction when no reaction-side terms are present,
ReactionValidationError::MissingReactants when no reactants are present, or
ReactionValidationError::MissingProducts when no products are present.
Trait Implementations§
Source§impl Clone for ReactionEquation
impl Clone for ReactionEquation
Source§fn clone(&self) -> ReactionEquation
fn clone(&self) -> ReactionEquation
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 ReactionEquation
impl Debug for ReactionEquation
Source§impl Default for ReactionEquation
impl Default for ReactionEquation
Source§impl Display for ReactionEquation
impl Display for ReactionEquation
Source§impl PartialEq for ReactionEquation
impl PartialEq for ReactionEquation
Source§fn eq(&self, other: &ReactionEquation) -> bool
fn eq(&self, other: &ReactionEquation) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ReactionEquation
impl StructuralPartialEq for ReactionEquation
Auto Trait Implementations§
impl Freeze for ReactionEquation
impl RefUnwindSafe for ReactionEquation
impl Send for ReactionEquation
impl Sync for ReactionEquation
impl Unpin for ReactionEquation
impl UnsafeUnpin for ReactionEquation
impl UnwindSafe for ReactionEquation
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