pub trait ChargedValences {
// Required method
fn valences_at_charge(&self, charge: i8) -> &'static [u8] ⓘ;
}Expand description
Allowed valence counts at a specific formal charge.
Required Methods§
Sourcefn valences_at_charge(&self, charge: i8) -> &'static [u8] ⓘ
fn valences_at_charge(&self, charge: i8) -> &'static [u8] ⓘ
Returns the allowed valences at the given formal charge.
charge must be in the range [-2, 2]. Values outside that range
return an empty slice.
§Examples
use elements_rs::{ChargedValences, Element};
assert_eq!(Element::N.valences_at_charge(0), &[3, 5]);
assert_eq!(Element::N.valences_at_charge(1), &[4]);
assert_eq!(Element::N.valences_at_charge(-1), &[2]);