Struct PolyatomicIon
pub struct PolyatomicIon(/* private fields */);Expand description
A polyatomic ion wrapper.
Implementations§
§impl PolyatomicIon
impl PolyatomicIon
pub fn new(
formula: ChemicalFormula,
charge: IonCharge,
) -> Result<PolyatomicIon, IonValidationError>
pub fn new( formula: ChemicalFormula, charge: IonCharge, ) -> Result<PolyatomicIon, IonValidationError>
Creates a polyatomic ion from a formula and charge.
§Errors
Returns IonValidationError::ExpectedPolyatomicFormula when formula does not contain
more than one atom.
pub fn from_ion(ion: Ion) -> Result<PolyatomicIon, IonValidationError>
pub fn from_ion(ion: Ion) -> Result<PolyatomicIon, 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§
§impl Clone for PolyatomicIon
impl Clone for PolyatomicIon
§fn clone(&self) -> PolyatomicIon
fn clone(&self) -> PolyatomicIon
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 more§impl Debug for PolyatomicIon
impl Debug for PolyatomicIon
§impl Display for PolyatomicIon
impl Display for PolyatomicIon
§impl PartialEq for PolyatomicIon
impl PartialEq for PolyatomicIon
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