Struct ElementOxidationState
pub struct ElementOxidationState { /* private fields */ }Expand description
An oxidation-state assignment for an element symbol.
Implementations§
§impl ElementOxidationState
impl ElementOxidationState
pub fn new(
element_symbol: &str,
state: OxidationState,
) -> Result<ElementOxidationState, OxidationStateValidationError>
pub fn new( element_symbol: &str, state: OxidationState, ) -> Result<ElementOxidationState, 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.
pub fn element_symbol(&self) -> &str
pub fn element_symbol(&self) -> &str
Returns the element symbol.
pub const fn state(&self) -> OxidationState
pub const fn state(&self) -> OxidationState
Returns the assigned oxidation state.
pub fn into_parts(self) -> (String, OxidationState)
pub fn into_parts(self) -> (String, OxidationState)
Consumes the assignment and returns its parts.
Trait Implementations§
§impl Clone for ElementOxidationState
impl Clone for ElementOxidationState
§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 more§impl Debug for ElementOxidationState
impl Debug for ElementOxidationState
§impl Display for ElementOxidationState
impl Display for ElementOxidationState
§impl Hash for ElementOxidationState
impl Hash for ElementOxidationState
§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