pub struct ElementOxidationState { /* private fields */ }Expand description
An oxidation-state assignment for an element symbol.
Implementations§
Source§impl ElementOxidationState
impl ElementOxidationState
Sourcepub fn new(
element_symbol: &str,
state: OxidationState,
) -> Result<Self, OxidationStateValidationError>
pub fn new( element_symbol: &str, state: OxidationState, ) -> Result<Self, OxidationStateValidationError>
Creates an element oxidation-state assignment.
§Errors
Returns OxidationStateValidationError::EmptyElementSymbol when element_symbol
is empty or whitespace only, or
OxidationStateValidationError::InvalidElementSymbol when the symbol does not
match the supported shape.
Sourcepub fn element_symbol(&self) -> &str
pub fn element_symbol(&self) -> &str
Returns the element symbol.
Sourcepub const fn state(&self) -> OxidationState
pub const fn state(&self) -> OxidationState
Returns the assigned oxidation state.
Sourcepub fn into_parts(self) -> (String, OxidationState)
pub fn into_parts(self) -> (String, OxidationState)
Consumes the assignment and returns its parts.
Trait Implementations§
Source§impl Clone for ElementOxidationState
impl Clone for ElementOxidationState
Source§fn clone(&self) -> ElementOxidationState
fn clone(&self) -> ElementOxidationState
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 moreSource§impl Debug for ElementOxidationState
impl Debug for ElementOxidationState
Source§impl Display for ElementOxidationState
impl Display for ElementOxidationState
Source§impl Hash for ElementOxidationState
impl Hash for ElementOxidationState
Source§impl PartialEq for ElementOxidationState
impl PartialEq for ElementOxidationState
impl Eq for ElementOxidationState
impl StructuralPartialEq for ElementOxidationState
Auto Trait Implementations§
impl Freeze for ElementOxidationState
impl RefUnwindSafe for ElementOxidationState
impl Send for ElementOxidationState
impl Sync for ElementOxidationState
impl Unpin for ElementOxidationState
impl UnsafeUnpin for ElementOxidationState
impl UnwindSafe for ElementOxidationState
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