pub struct IonCharge { /* private fields */ }Expand description
A nonzero signed ionic charge.
Implementations§
Source§impl IonCharge
impl IonCharge
Sourcepub const fn positive(magnitude: u8) -> Result<Self, IonValidationError>
pub const fn positive(magnitude: u8) -> Result<Self, IonValidationError>
Creates a positive ion charge.
§Errors
Returns IonValidationError::ZeroChargeMagnitude when magnitude is zero.
Sourcepub const fn negative(magnitude: u8) -> Result<Self, IonValidationError>
pub const fn negative(magnitude: u8) -> Result<Self, IonValidationError>
Creates a negative ion charge.
§Errors
Returns IonValidationError::ZeroChargeMagnitude when magnitude is zero.
Sourcepub const fn sign(self) -> ChargeSign
pub const fn sign(self) -> ChargeSign
Returns the charge sign.
Sourcepub const fn magnitude_value(self) -> ChargeMagnitude
pub const fn magnitude_value(self) -> ChargeMagnitude
Returns the charge magnitude wrapper.
Sourcepub const fn is_positive(self) -> bool
pub const fn is_positive(self) -> bool
Returns true for a positive charge.
Sourcepub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
Returns true for a negative charge.
Trait Implementations§
Source§impl Ord for IonCharge
impl Ord for IonCharge
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for IonCharge
impl PartialOrd for IonCharge
impl Copy for IonCharge
impl Eq for IonCharge
impl StructuralPartialEq for IonCharge
Auto Trait Implementations§
impl Freeze for IonCharge
impl RefUnwindSafe for IonCharge
impl Send for IonCharge
impl Sync for IonCharge
impl Unpin for IonCharge
impl UnsafeUnpin for IonCharge
impl UnwindSafe for IonCharge
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