pub struct ChemicalReaction { /* private fields */ }Expand description
A chemical reaction with an equation, optional conditions, and classification labels.
Implementations§
Source§impl ChemicalReaction
impl ChemicalReaction
Sourcepub const fn new() -> ChemicalReaction
pub const fn new() -> ChemicalReaction
Creates an empty reaction builder/value.
Sourcepub fn with_reactant<T>(self, reactant: T) -> ChemicalReaction
pub fn with_reactant<T>(self, reactant: T) -> ChemicalReaction
Adds a reactant and returns the updated reaction.
Sourcepub fn with_product<T>(self, product: T) -> ChemicalReaction
pub fn with_product<T>(self, product: T) -> ChemicalReaction
Adds a product and returns the updated reaction.
Sourcepub fn with_arrow(self, arrow: ReactionArrow) -> ChemicalReaction
pub fn with_arrow(self, arrow: ReactionArrow) -> ChemicalReaction
Sets the reaction arrow.
Sourcepub fn with_condition<T>(self, condition: T) -> ChemicalReactionwhere
T: Into<ReactionCondition>,
pub fn with_condition<T>(self, condition: T) -> ChemicalReactionwhere
T: Into<ReactionCondition>,
Adds a condition and returns the updated reaction.
Sourcepub fn with_kind(self, kind: ReactionKind) -> ChemicalReaction
pub fn with_kind(self, kind: ReactionKind) -> ChemicalReaction
Adds a kind label if it is not already present.
Sourcepub const fn equation(&self) -> &ReactionEquation
pub const fn equation(&self) -> &ReactionEquation
Returns the reaction equation.
Sourcepub const fn arrow(&self) -> ReactionArrow
pub const fn arrow(&self) -> ReactionArrow
Returns the reaction arrow.
Sourcepub const fn conditions(&self) -> &ReactionConditionSet
pub const fn conditions(&self) -> &ReactionConditionSet
Returns the reaction conditions.
Sourcepub fn kinds(&self) -> &[ReactionKind]
pub fn kinds(&self) -> &[ReactionKind]
Returns reaction kind labels in insertion order.
Sourcepub fn validate(&self) -> Result<(), ReactionValidationError>
pub fn validate(&self) -> Result<(), ReactionValidationError>
Validates the equation and condition descriptors.
§Errors
Returns a ReactionValidationError when the equation is incomplete or a condition label
is empty.
Trait Implementations§
Source§impl Clone for ChemicalReaction
impl Clone for ChemicalReaction
Source§fn clone(&self) -> ChemicalReaction
fn clone(&self) -> ChemicalReaction
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 ChemicalReaction
impl Debug for ChemicalReaction
Source§impl Default for ChemicalReaction
impl Default for ChemicalReaction
Source§fn default() -> ChemicalReaction
fn default() -> ChemicalReaction
Returns the “default value” for a type. Read more
Source§impl Display for ChemicalReaction
impl Display for ChemicalReaction
Source§impl PartialEq for ChemicalReaction
impl PartialEq for ChemicalReaction
impl Eq for ChemicalReaction
impl StructuralPartialEq for ChemicalReaction
Auto Trait Implementations§
impl Freeze for ChemicalReaction
impl RefUnwindSafe for ChemicalReaction
impl Send for ChemicalReaction
impl Sync for ChemicalReaction
impl Unpin for ChemicalReaction
impl UnsafeUnpin for ChemicalReaction
impl UnwindSafe for ChemicalReaction
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