pub struct CompoundFormula(/* private fields */);Expand description
A compound-facing chemical formula wrapper.
Implementations§
Source§impl CompoundFormula
impl CompoundFormula
Sourcepub const fn new(formula: ChemicalFormula) -> Self
pub const fn new(formula: ChemicalFormula) -> Self
Creates a compound formula wrapper.
Sourcepub const fn as_formula(&self) -> &ChemicalFormula
pub const fn as_formula(&self) -> &ChemicalFormula
Returns the wrapped formula.
Sourcepub fn into_formula(self) -> ChemicalFormula
pub fn into_formula(self) -> ChemicalFormula
Consumes the wrapper and returns the formula.
Trait Implementations§
Source§impl AsRef<ChemicalFormula> for CompoundFormula
impl AsRef<ChemicalFormula> for CompoundFormula
Source§fn as_ref(&self) -> &ChemicalFormula
fn as_ref(&self) -> &ChemicalFormula
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for CompoundFormula
impl Clone for CompoundFormula
Source§fn clone(&self) -> CompoundFormula
fn clone(&self) -> CompoundFormula
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 CompoundFormula
impl Debug for CompoundFormula
Source§impl Display for CompoundFormula
impl Display for CompoundFormula
Source§impl From<ChemicalFormula> for CompoundFormula
impl From<ChemicalFormula> for CompoundFormula
Source§fn from(value: ChemicalFormula) -> Self
fn from(value: ChemicalFormula) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CompoundFormula
impl PartialEq for CompoundFormula
Source§fn eq(&self, other: &CompoundFormula) -> bool
fn eq(&self, other: &CompoundFormula) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for CompoundFormula
impl StructuralPartialEq for CompoundFormula
Auto Trait Implementations§
impl Freeze for CompoundFormula
impl RefUnwindSafe for CompoundFormula
impl Send for CompoundFormula
impl Sync for CompoundFormula
impl Unpin for CompoundFormula
impl UnsafeUnpin for CompoundFormula
impl UnwindSafe for CompoundFormula
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