use std::fmt;
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum ReactionSide {
Reactant,
Product,
}
impl ReactionSide {
#[must_use]
pub const fn is_reactant(self) -> bool {
matches!(self, Self::Reactant)
}
#[must_use]
pub const fn is_product(self) -> bool {
matches!(self, Self::Product)
}
}
impl fmt::Display for ReactionSide {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Reactant => formatter.write_str("reactant"),
Self::Product => formatter.write_str("product"),
}
}
}