pub struct PolyatomicIon(/* private fields */);Expand description
A polyatomic ion wrapper.
Implementations§
Source§impl PolyatomicIon
impl PolyatomicIon
Sourcepub fn new(
formula: ChemicalFormula,
charge: IonCharge,
) -> Result<Self, IonValidationError>
pub fn new( formula: ChemicalFormula, charge: IonCharge, ) -> Result<Self, IonValidationError>
Creates a polyatomic ion from a formula and charge.
§Errors
Returns IonValidationError::ExpectedPolyatomicFormula when formula does not contain
more than one atom.
Sourcepub fn from_ion(ion: Ion) -> Result<Self, IonValidationError>
pub fn from_ion(ion: Ion) -> Result<Self, IonValidationError>
Wraps an existing ion after polyatomic formula validation.
§Errors
Returns IonValidationError::ExpectedPolyatomicFormula when the ion formula does not
contain more than one atom.
Trait Implementations§
Source§impl Clone for PolyatomicIon
impl Clone for PolyatomicIon
Source§fn clone(&self) -> PolyatomicIon
fn clone(&self) -> PolyatomicIon
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 PolyatomicIon
impl Debug for PolyatomicIon
Source§impl Display for PolyatomicIon
impl Display for PolyatomicIon
Source§impl PartialEq for PolyatomicIon
impl PartialEq for PolyatomicIon
Source§fn eq(&self, other: &PolyatomicIon) -> bool
fn eq(&self, other: &PolyatomicIon) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for PolyatomicIon
impl StructuralPartialEq for PolyatomicIon
Auto Trait Implementations§
impl Freeze for PolyatomicIon
impl RefUnwindSafe for PolyatomicIon
impl Send for PolyatomicIon
impl Sync for PolyatomicIon
impl Unpin for PolyatomicIon
impl UnsafeUnpin for PolyatomicIon
impl UnwindSafe for PolyatomicIon
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