pub enum Element {
Show 118 variants
H,
He,
Li,
Be,
B,
C,
N,
O,
F,
Ne,
Na,
Mg,
Al,
Si,
P,
S,
Cl,
Ar,
K,
Ca,
Sc,
Ti,
V,
Cr,
Mn,
Fe,
Co,
Ni,
Cu,
Zn,
Ga,
Ge,
As,
Se,
Br,
Kr,
Rb,
Sr,
Y,
Zr,
Nb,
Mo,
Tc,
Ru,
Rh,
Pd,
Ag,
Cd,
In,
Sn,
Sb,
Te,
I,
Xe,
Cs,
Ba,
La,
Ce,
Pr,
Nd,
Pm,
Sm,
Eu,
Gd,
Tb,
Dy,
Ho,
Er,
Tm,
Yb,
Lu,
Hf,
Ta,
W,
Re,
Os,
Ir,
Pt,
Au,
Hg,
Tl,
Pb,
Bi,
Po,
At,
Rn,
Fr,
Ra,
Ac,
Th,
Pa,
U,
Np,
Pu,
Am,
Cm,
Bk,
Cf,
Es,
Fm,
Md,
No,
Lr,
Rf,
Db,
Sg,
Bh,
Hs,
Mt,
Ds,
Rg,
Cn,
Nh,
Fl,
Mc,
Lv,
Ts,
Og,
}Expand description
All 118 elements of the periodic table.
use elements_rs::Element;
let oxygen = Element::O;
assert_eq!(oxygen.name(), "Oxygen");
assert_eq!(oxygen.standard_atomic_weight(), 15.999);Variants§
H
Hydrogen
He
Helium
Li
Lithium
Be
Beryllium
B
Boron
C
Carbon
N
Nitrogen
O
Oxygen
F
Fluorine
Ne
Neon
Na
Sodium
Mg
Magnesium
Al
Aluminium
Si
Silicon
P
Phosphorus
S
Sulfur
Cl
Chlorine
Ar
Argon
K
Potassium
Ca
Calcium
Sc
Scandium
Ti
Titanium
V
Vanadium
Cr
Chromium
Mn
Manganese
Fe
Iron
Co
Cobalt
Ni
Nickel
Cu
Copper
Zn
Zinc
Ga
Gallium
Ge
Germanium
As
Arsenic
Se
Selenium
Br
Bromine
Kr
Krypton
Rb
Rubidium
Sr
Strontium
Y
Yttrium
Zr
Zirconium
Nb
Niobium
Mo
Molybdenum
Tc
Technetium
Ru
Ruthenium
Rh
Rhodium
Pd
Palladium
Ag
Silver
Cd
Cadmium
In
Indium
Sn
Tin
Sb
Antimony
Te
Tellurium
I
Iodine
Xe
Xenon
Cs
Caesium
Ba
Barium
La
Lanthanum
Ce
Cerium
Pr
Praseodymium
Nd
Neodymium
Pm
Promethium
Sm
Samarium
Eu
Europium
Gd
Gadolinium
Tb
Terbium
Dy
Dysprosium
Ho
Holmium
Er
Erbium
Tm
Thulium
Yb
Ytterbium
Lu
Lutetium
Hf
Hafnium
Ta
Tantalum
W
Tungsten
Re
Rhenium
Os
Osmium
Ir
Iridium
Pt
Platinum
Au
Gold
Hg
Mercury
Tl
Thallium
Pb
Lead
Bi
Bismuth
Po
Polonium
At
Astatine
Rn
Radon
Fr
Francium
Ra
Radium
Ac
Actinium
Th
Thorium
Pa
Protactinium
U
Uranium
Np
Neptunium
Pu
Plutonium
Am
Americium
Cm
Curium
Bk
Berkelium
Cf
Californium
Es
Einsteinium
Fm
Fermium
Md
Mendelevium
No
Nobelium
Lr
Lawrencium
Rf
Rutherfordium
Db
Dubnium
Sg
Seaborgium
Bh
Bohrium
Hs
Hassium
Mt
Meitnerium
Ds
Darmstadtium
Rg
Roentgenium
Cn
Copernicium
Nh
Nihonium
Fl
Flerovium
Mc
Moscovium
Lv
Livermorium
Ts
Tennessine
Og
Oganesson
Implementations§
Source§impl Element
impl Element
Sourcepub fn most_abundant_isotope(&self) -> Isotope
pub fn most_abundant_isotope(&self) -> Isotope
Returns the most common isotope of the element.
Source§impl Element
impl Element
Sourcepub fn orbitals(&self) -> &'static [AtomicOrbital]
pub fn orbitals(&self) -> &'static [AtomicOrbital]
Returns the orbitals associated to the element.
§Examples
use elements_rs::{AtomicOrbitalType, Element};
let orbitals = Element::H.orbitals();
assert_eq!(orbitals.len(), 1);
assert_eq!(orbitals[0].orbital_type(), AtomicOrbitalType::S);
assert_eq!(orbitals[0].number_of_electrons(), 1);Source§impl Element
impl Element
Sourcepub fn is_valid_oxidation_state(&self, state: i16) -> bool
pub fn is_valid_oxidation_state(&self, state: i16) -> bool
Returns whether the oxidation state is valid for this element.
§Examples
use elements_rs::Element;
assert!(Element::O.is_valid_oxidation_state(-2));
assert!(!Element::O.is_valid_oxidation_state(3));Sourcepub fn oxidation_states(&self) -> &[i16]
pub fn oxidation_states(&self) -> &[i16]
Returns all valid oxidation states.
§Examples
use elements_rs::Element;
let states = Element::H.oxidation_states();
assert!(states.contains(&1));
assert!(states.contains(&-1));Trait Implementations§
Source§impl BondsNumber for Element
impl BondsNumber for Element
Source§impl<'de> Deserialize<'de> for Element
impl<'de> Deserialize<'de> for Element
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<ActiniumIsotope> for Element
impl From<ActiniumIsotope> for Element
Source§fn from(_isotope: ActiniumIsotope) -> Self
fn from(_isotope: ActiniumIsotope) -> Self
Source§impl From<AluminiumIsotope> for Element
impl From<AluminiumIsotope> for Element
Source§fn from(_isotope: AluminiumIsotope) -> Self
fn from(_isotope: AluminiumIsotope) -> Self
Source§impl From<AmericiumIsotope> for Element
impl From<AmericiumIsotope> for Element
Source§fn from(_isotope: AmericiumIsotope) -> Self
fn from(_isotope: AmericiumIsotope) -> Self
Source§impl From<AntimonyIsotope> for Element
impl From<AntimonyIsotope> for Element
Source§fn from(_isotope: AntimonyIsotope) -> Self
fn from(_isotope: AntimonyIsotope) -> Self
Source§impl From<ArgonIsotope> for Element
impl From<ArgonIsotope> for Element
Source§fn from(_isotope: ArgonIsotope) -> Self
fn from(_isotope: ArgonIsotope) -> Self
Source§impl From<ArsenicIsotope> for Element
impl From<ArsenicIsotope> for Element
Source§fn from(_isotope: ArsenicIsotope) -> Self
fn from(_isotope: ArsenicIsotope) -> Self
Source§impl From<AstatineIsotope> for Element
impl From<AstatineIsotope> for Element
Source§fn from(_isotope: AstatineIsotope) -> Self
fn from(_isotope: AstatineIsotope) -> Self
Source§impl From<BariumIsotope> for Element
impl From<BariumIsotope> for Element
Source§fn from(_isotope: BariumIsotope) -> Self
fn from(_isotope: BariumIsotope) -> Self
Source§impl From<BerkeliumIsotope> for Element
impl From<BerkeliumIsotope> for Element
Source§fn from(_isotope: BerkeliumIsotope) -> Self
fn from(_isotope: BerkeliumIsotope) -> Self
Source§impl From<BerylliumIsotope> for Element
impl From<BerylliumIsotope> for Element
Source§fn from(_isotope: BerylliumIsotope) -> Self
fn from(_isotope: BerylliumIsotope) -> Self
Source§impl From<BismuthIsotope> for Element
impl From<BismuthIsotope> for Element
Source§fn from(_isotope: BismuthIsotope) -> Self
fn from(_isotope: BismuthIsotope) -> Self
Source§impl From<BohriumIsotope> for Element
impl From<BohriumIsotope> for Element
Source§fn from(_isotope: BohriumIsotope) -> Self
fn from(_isotope: BohriumIsotope) -> Self
Source§impl From<BoronIsotope> for Element
impl From<BoronIsotope> for Element
Source§fn from(_isotope: BoronIsotope) -> Self
fn from(_isotope: BoronIsotope) -> Self
Source§impl From<BromineIsotope> for Element
impl From<BromineIsotope> for Element
Source§fn from(_isotope: BromineIsotope) -> Self
fn from(_isotope: BromineIsotope) -> Self
Source§impl From<CadmiumIsotope> for Element
impl From<CadmiumIsotope> for Element
Source§fn from(_isotope: CadmiumIsotope) -> Self
fn from(_isotope: CadmiumIsotope) -> Self
Source§impl From<CaesiumIsotope> for Element
impl From<CaesiumIsotope> for Element
Source§fn from(_isotope: CaesiumIsotope) -> Self
fn from(_isotope: CaesiumIsotope) -> Self
Source§impl From<CalciumIsotope> for Element
impl From<CalciumIsotope> for Element
Source§fn from(_isotope: CalciumIsotope) -> Self
fn from(_isotope: CalciumIsotope) -> Self
Source§impl From<CaliforniumIsotope> for Element
impl From<CaliforniumIsotope> for Element
Source§fn from(_isotope: CaliforniumIsotope) -> Self
fn from(_isotope: CaliforniumIsotope) -> Self
Source§impl From<CarbonIsotope> for Element
impl From<CarbonIsotope> for Element
Source§fn from(_isotope: CarbonIsotope) -> Self
fn from(_isotope: CarbonIsotope) -> Self
Source§impl From<CeriumIsotope> for Element
impl From<CeriumIsotope> for Element
Source§fn from(_isotope: CeriumIsotope) -> Self
fn from(_isotope: CeriumIsotope) -> Self
Source§impl From<ChlorineIsotope> for Element
impl From<ChlorineIsotope> for Element
Source§fn from(_isotope: ChlorineIsotope) -> Self
fn from(_isotope: ChlorineIsotope) -> Self
Source§impl From<ChromiumIsotope> for Element
impl From<ChromiumIsotope> for Element
Source§fn from(_isotope: ChromiumIsotope) -> Self
fn from(_isotope: ChromiumIsotope) -> Self
Source§impl From<CobaltIsotope> for Element
impl From<CobaltIsotope> for Element
Source§fn from(_isotope: CobaltIsotope) -> Self
fn from(_isotope: CobaltIsotope) -> Self
Source§impl From<CoperniciumIsotope> for Element
impl From<CoperniciumIsotope> for Element
Source§fn from(_isotope: CoperniciumIsotope) -> Self
fn from(_isotope: CoperniciumIsotope) -> Self
Source§impl From<CopperIsotope> for Element
impl From<CopperIsotope> for Element
Source§fn from(_isotope: CopperIsotope) -> Self
fn from(_isotope: CopperIsotope) -> Self
Source§impl From<CuriumIsotope> for Element
impl From<CuriumIsotope> for Element
Source§fn from(_isotope: CuriumIsotope) -> Self
fn from(_isotope: CuriumIsotope) -> Self
Source§impl From<DarmstadtiumIsotope> for Element
impl From<DarmstadtiumIsotope> for Element
Source§fn from(_isotope: DarmstadtiumIsotope) -> Self
fn from(_isotope: DarmstadtiumIsotope) -> Self
Source§impl From<DubniumIsotope> for Element
impl From<DubniumIsotope> for Element
Source§fn from(_isotope: DubniumIsotope) -> Self
fn from(_isotope: DubniumIsotope) -> Self
Source§impl From<DysprosiumIsotope> for Element
impl From<DysprosiumIsotope> for Element
Source§fn from(_isotope: DysprosiumIsotope) -> Self
fn from(_isotope: DysprosiumIsotope) -> Self
Source§impl From<EinsteiniumIsotope> for Element
impl From<EinsteiniumIsotope> for Element
Source§fn from(_isotope: EinsteiniumIsotope) -> Self
fn from(_isotope: EinsteiniumIsotope) -> Self
Source§impl From<Element> for ElementMask
impl From<Element> for ElementMask
Source§impl From<ErbiumIsotope> for Element
impl From<ErbiumIsotope> for Element
Source§fn from(_isotope: ErbiumIsotope) -> Self
fn from(_isotope: ErbiumIsotope) -> Self
Source§impl From<EuropiumIsotope> for Element
impl From<EuropiumIsotope> for Element
Source§fn from(_isotope: EuropiumIsotope) -> Self
fn from(_isotope: EuropiumIsotope) -> Self
Source§impl From<FermiumIsotope> for Element
impl From<FermiumIsotope> for Element
Source§fn from(_isotope: FermiumIsotope) -> Self
fn from(_isotope: FermiumIsotope) -> Self
Source§impl From<FleroviumIsotope> for Element
impl From<FleroviumIsotope> for Element
Source§fn from(_isotope: FleroviumIsotope) -> Self
fn from(_isotope: FleroviumIsotope) -> Self
Source§impl From<FluorineIsotope> for Element
impl From<FluorineIsotope> for Element
Source§fn from(_isotope: FluorineIsotope) -> Self
fn from(_isotope: FluorineIsotope) -> Self
Source§impl From<FranciumIsotope> for Element
impl From<FranciumIsotope> for Element
Source§fn from(_isotope: FranciumIsotope) -> Self
fn from(_isotope: FranciumIsotope) -> Self
Source§impl From<GadoliniumIsotope> for Element
impl From<GadoliniumIsotope> for Element
Source§fn from(_isotope: GadoliniumIsotope) -> Self
fn from(_isotope: GadoliniumIsotope) -> Self
Source§impl From<GalliumIsotope> for Element
impl From<GalliumIsotope> for Element
Source§fn from(_isotope: GalliumIsotope) -> Self
fn from(_isotope: GalliumIsotope) -> Self
Source§impl From<GermaniumIsotope> for Element
impl From<GermaniumIsotope> for Element
Source§fn from(_isotope: GermaniumIsotope) -> Self
fn from(_isotope: GermaniumIsotope) -> Self
Source§impl From<GoldIsotope> for Element
impl From<GoldIsotope> for Element
Source§fn from(_isotope: GoldIsotope) -> Self
fn from(_isotope: GoldIsotope) -> Self
Source§impl From<HafniumIsotope> for Element
impl From<HafniumIsotope> for Element
Source§fn from(_isotope: HafniumIsotope) -> Self
fn from(_isotope: HafniumIsotope) -> Self
Source§impl From<HassiumIsotope> for Element
impl From<HassiumIsotope> for Element
Source§fn from(_isotope: HassiumIsotope) -> Self
fn from(_isotope: HassiumIsotope) -> Self
Source§impl From<HeliumIsotope> for Element
impl From<HeliumIsotope> for Element
Source§fn from(_isotope: HeliumIsotope) -> Self
fn from(_isotope: HeliumIsotope) -> Self
Source§impl From<HolmiumIsotope> for Element
impl From<HolmiumIsotope> for Element
Source§fn from(_isotope: HolmiumIsotope) -> Self
fn from(_isotope: HolmiumIsotope) -> Self
Source§impl From<HydrogenIsotope> for Element
impl From<HydrogenIsotope> for Element
Source§fn from(_isotope: HydrogenIsotope) -> Self
fn from(_isotope: HydrogenIsotope) -> Self
Source§impl From<IndiumIsotope> for Element
impl From<IndiumIsotope> for Element
Source§fn from(_isotope: IndiumIsotope) -> Self
fn from(_isotope: IndiumIsotope) -> Self
Source§impl From<IodineIsotope> for Element
impl From<IodineIsotope> for Element
Source§fn from(_isotope: IodineIsotope) -> Self
fn from(_isotope: IodineIsotope) -> Self
Source§impl From<IridiumIsotope> for Element
impl From<IridiumIsotope> for Element
Source§fn from(_isotope: IridiumIsotope) -> Self
fn from(_isotope: IridiumIsotope) -> Self
Source§impl From<IronIsotope> for Element
impl From<IronIsotope> for Element
Source§fn from(_isotope: IronIsotope) -> Self
fn from(_isotope: IronIsotope) -> Self
Source§impl From<KryptonIsotope> for Element
impl From<KryptonIsotope> for Element
Source§fn from(_isotope: KryptonIsotope) -> Self
fn from(_isotope: KryptonIsotope) -> Self
Source§impl From<LanthanumIsotope> for Element
impl From<LanthanumIsotope> for Element
Source§fn from(_isotope: LanthanumIsotope) -> Self
fn from(_isotope: LanthanumIsotope) -> Self
Source§impl From<LawrenciumIsotope> for Element
impl From<LawrenciumIsotope> for Element
Source§fn from(_isotope: LawrenciumIsotope) -> Self
fn from(_isotope: LawrenciumIsotope) -> Self
Source§impl From<LeadIsotope> for Element
impl From<LeadIsotope> for Element
Source§fn from(_isotope: LeadIsotope) -> Self
fn from(_isotope: LeadIsotope) -> Self
Source§impl From<LithiumIsotope> for Element
impl From<LithiumIsotope> for Element
Source§fn from(_isotope: LithiumIsotope) -> Self
fn from(_isotope: LithiumIsotope) -> Self
Source§impl From<LivermoriumIsotope> for Element
impl From<LivermoriumIsotope> for Element
Source§fn from(_isotope: LivermoriumIsotope) -> Self
fn from(_isotope: LivermoriumIsotope) -> Self
Source§impl From<LutetiumIsotope> for Element
impl From<LutetiumIsotope> for Element
Source§fn from(_isotope: LutetiumIsotope) -> Self
fn from(_isotope: LutetiumIsotope) -> Self
Source§impl From<MagnesiumIsotope> for Element
impl From<MagnesiumIsotope> for Element
Source§fn from(_isotope: MagnesiumIsotope) -> Self
fn from(_isotope: MagnesiumIsotope) -> Self
Source§impl From<ManganeseIsotope> for Element
impl From<ManganeseIsotope> for Element
Source§fn from(_isotope: ManganeseIsotope) -> Self
fn from(_isotope: ManganeseIsotope) -> Self
Source§impl From<MeitneriumIsotope> for Element
impl From<MeitneriumIsotope> for Element
Source§fn from(_isotope: MeitneriumIsotope) -> Self
fn from(_isotope: MeitneriumIsotope) -> Self
Source§impl From<MendeleviumIsotope> for Element
impl From<MendeleviumIsotope> for Element
Source§fn from(_isotope: MendeleviumIsotope) -> Self
fn from(_isotope: MendeleviumIsotope) -> Self
Source§impl From<MercuryIsotope> for Element
impl From<MercuryIsotope> for Element
Source§fn from(_isotope: MercuryIsotope) -> Self
fn from(_isotope: MercuryIsotope) -> Self
Source§impl From<MolybdenumIsotope> for Element
impl From<MolybdenumIsotope> for Element
Source§fn from(_isotope: MolybdenumIsotope) -> Self
fn from(_isotope: MolybdenumIsotope) -> Self
Source§impl From<MoscoviumIsotope> for Element
impl From<MoscoviumIsotope> for Element
Source§fn from(_isotope: MoscoviumIsotope) -> Self
fn from(_isotope: MoscoviumIsotope) -> Self
Source§impl From<NeodymiumIsotope> for Element
impl From<NeodymiumIsotope> for Element
Source§fn from(_isotope: NeodymiumIsotope) -> Self
fn from(_isotope: NeodymiumIsotope) -> Self
Source§impl From<NeonIsotope> for Element
impl From<NeonIsotope> for Element
Source§fn from(_isotope: NeonIsotope) -> Self
fn from(_isotope: NeonIsotope) -> Self
Source§impl From<NeptuniumIsotope> for Element
impl From<NeptuniumIsotope> for Element
Source§fn from(_isotope: NeptuniumIsotope) -> Self
fn from(_isotope: NeptuniumIsotope) -> Self
Source§impl From<NickelIsotope> for Element
impl From<NickelIsotope> for Element
Source§fn from(_isotope: NickelIsotope) -> Self
fn from(_isotope: NickelIsotope) -> Self
Source§impl From<NihoniumIsotope> for Element
impl From<NihoniumIsotope> for Element
Source§fn from(_isotope: NihoniumIsotope) -> Self
fn from(_isotope: NihoniumIsotope) -> Self
Source§impl From<NiobiumIsotope> for Element
impl From<NiobiumIsotope> for Element
Source§fn from(_isotope: NiobiumIsotope) -> Self
fn from(_isotope: NiobiumIsotope) -> Self
Source§impl From<NitrogenIsotope> for Element
impl From<NitrogenIsotope> for Element
Source§fn from(_isotope: NitrogenIsotope) -> Self
fn from(_isotope: NitrogenIsotope) -> Self
Source§impl From<NobeliumIsotope> for Element
impl From<NobeliumIsotope> for Element
Source§fn from(_isotope: NobeliumIsotope) -> Self
fn from(_isotope: NobeliumIsotope) -> Self
Source§impl From<OganessonIsotope> for Element
impl From<OganessonIsotope> for Element
Source§fn from(_isotope: OganessonIsotope) -> Self
fn from(_isotope: OganessonIsotope) -> Self
Source§impl From<OsmiumIsotope> for Element
impl From<OsmiumIsotope> for Element
Source§fn from(_isotope: OsmiumIsotope) -> Self
fn from(_isotope: OsmiumIsotope) -> Self
Source§impl From<OxygenIsotope> for Element
impl From<OxygenIsotope> for Element
Source§fn from(_isotope: OxygenIsotope) -> Self
fn from(_isotope: OxygenIsotope) -> Self
Source§impl From<PalladiumIsotope> for Element
impl From<PalladiumIsotope> for Element
Source§fn from(_isotope: PalladiumIsotope) -> Self
fn from(_isotope: PalladiumIsotope) -> Self
Source§impl From<PhosphorusIsotope> for Element
impl From<PhosphorusIsotope> for Element
Source§fn from(_isotope: PhosphorusIsotope) -> Self
fn from(_isotope: PhosphorusIsotope) -> Self
Source§impl From<PlatinumIsotope> for Element
impl From<PlatinumIsotope> for Element
Source§fn from(_isotope: PlatinumIsotope) -> Self
fn from(_isotope: PlatinumIsotope) -> Self
Source§impl From<PlutoniumIsotope> for Element
impl From<PlutoniumIsotope> for Element
Source§fn from(_isotope: PlutoniumIsotope) -> Self
fn from(_isotope: PlutoniumIsotope) -> Self
Source§impl From<PoloniumIsotope> for Element
impl From<PoloniumIsotope> for Element
Source§fn from(_isotope: PoloniumIsotope) -> Self
fn from(_isotope: PoloniumIsotope) -> Self
Source§impl From<PotassiumIsotope> for Element
impl From<PotassiumIsotope> for Element
Source§fn from(_isotope: PotassiumIsotope) -> Self
fn from(_isotope: PotassiumIsotope) -> Self
Source§impl From<PraseodymiumIsotope> for Element
impl From<PraseodymiumIsotope> for Element
Source§fn from(_isotope: PraseodymiumIsotope) -> Self
fn from(_isotope: PraseodymiumIsotope) -> Self
Source§impl From<PromethiumIsotope> for Element
impl From<PromethiumIsotope> for Element
Source§fn from(_isotope: PromethiumIsotope) -> Self
fn from(_isotope: PromethiumIsotope) -> Self
Source§impl From<ProtactiniumIsotope> for Element
impl From<ProtactiniumIsotope> for Element
Source§fn from(_isotope: ProtactiniumIsotope) -> Self
fn from(_isotope: ProtactiniumIsotope) -> Self
Source§impl From<RadiumIsotope> for Element
impl From<RadiumIsotope> for Element
Source§fn from(_isotope: RadiumIsotope) -> Self
fn from(_isotope: RadiumIsotope) -> Self
Source§impl From<RadonIsotope> for Element
impl From<RadonIsotope> for Element
Source§fn from(_isotope: RadonIsotope) -> Self
fn from(_isotope: RadonIsotope) -> Self
Source§impl From<RheniumIsotope> for Element
impl From<RheniumIsotope> for Element
Source§fn from(_isotope: RheniumIsotope) -> Self
fn from(_isotope: RheniumIsotope) -> Self
Source§impl From<RhodiumIsotope> for Element
impl From<RhodiumIsotope> for Element
Source§fn from(_isotope: RhodiumIsotope) -> Self
fn from(_isotope: RhodiumIsotope) -> Self
Source§impl From<RoentgeniumIsotope> for Element
impl From<RoentgeniumIsotope> for Element
Source§fn from(_isotope: RoentgeniumIsotope) -> Self
fn from(_isotope: RoentgeniumIsotope) -> Self
Source§impl From<RubidiumIsotope> for Element
impl From<RubidiumIsotope> for Element
Source§fn from(_isotope: RubidiumIsotope) -> Self
fn from(_isotope: RubidiumIsotope) -> Self
Source§impl From<RutheniumIsotope> for Element
impl From<RutheniumIsotope> for Element
Source§fn from(_isotope: RutheniumIsotope) -> Self
fn from(_isotope: RutheniumIsotope) -> Self
Source§impl From<RutherfordiumIsotope> for Element
impl From<RutherfordiumIsotope> for Element
Source§fn from(_isotope: RutherfordiumIsotope) -> Self
fn from(_isotope: RutherfordiumIsotope) -> Self
Source§impl From<SamariumIsotope> for Element
impl From<SamariumIsotope> for Element
Source§fn from(_isotope: SamariumIsotope) -> Self
fn from(_isotope: SamariumIsotope) -> Self
Source§impl From<ScandiumIsotope> for Element
impl From<ScandiumIsotope> for Element
Source§fn from(_isotope: ScandiumIsotope) -> Self
fn from(_isotope: ScandiumIsotope) -> Self
Source§impl From<SeaborgiumIsotope> for Element
impl From<SeaborgiumIsotope> for Element
Source§fn from(_isotope: SeaborgiumIsotope) -> Self
fn from(_isotope: SeaborgiumIsotope) -> Self
Source§impl From<SeleniumIsotope> for Element
impl From<SeleniumIsotope> for Element
Source§fn from(_isotope: SeleniumIsotope) -> Self
fn from(_isotope: SeleniumIsotope) -> Self
Source§impl From<SiliconIsotope> for Element
impl From<SiliconIsotope> for Element
Source§fn from(_isotope: SiliconIsotope) -> Self
fn from(_isotope: SiliconIsotope) -> Self
Source§impl From<SilverIsotope> for Element
impl From<SilverIsotope> for Element
Source§fn from(_isotope: SilverIsotope) -> Self
fn from(_isotope: SilverIsotope) -> Self
Source§impl From<SodiumIsotope> for Element
impl From<SodiumIsotope> for Element
Source§fn from(_isotope: SodiumIsotope) -> Self
fn from(_isotope: SodiumIsotope) -> Self
Source§impl From<StrontiumIsotope> for Element
impl From<StrontiumIsotope> for Element
Source§fn from(_isotope: StrontiumIsotope) -> Self
fn from(_isotope: StrontiumIsotope) -> Self
Source§impl From<SulfurIsotope> for Element
impl From<SulfurIsotope> for Element
Source§fn from(_isotope: SulfurIsotope) -> Self
fn from(_isotope: SulfurIsotope) -> Self
Source§impl From<TantalumIsotope> for Element
impl From<TantalumIsotope> for Element
Source§fn from(_isotope: TantalumIsotope) -> Self
fn from(_isotope: TantalumIsotope) -> Self
Source§impl From<TechnetiumIsotope> for Element
impl From<TechnetiumIsotope> for Element
Source§fn from(_isotope: TechnetiumIsotope) -> Self
fn from(_isotope: TechnetiumIsotope) -> Self
Source§impl From<TelluriumIsotope> for Element
impl From<TelluriumIsotope> for Element
Source§fn from(_isotope: TelluriumIsotope) -> Self
fn from(_isotope: TelluriumIsotope) -> Self
Source§impl From<TennessineIsotope> for Element
impl From<TennessineIsotope> for Element
Source§fn from(_isotope: TennessineIsotope) -> Self
fn from(_isotope: TennessineIsotope) -> Self
Source§impl From<TerbiumIsotope> for Element
impl From<TerbiumIsotope> for Element
Source§fn from(_isotope: TerbiumIsotope) -> Self
fn from(_isotope: TerbiumIsotope) -> Self
Source§impl From<ThalliumIsotope> for Element
impl From<ThalliumIsotope> for Element
Source§fn from(_isotope: ThalliumIsotope) -> Self
fn from(_isotope: ThalliumIsotope) -> Self
Source§impl From<ThoriumIsotope> for Element
impl From<ThoriumIsotope> for Element
Source§fn from(_isotope: ThoriumIsotope) -> Self
fn from(_isotope: ThoriumIsotope) -> Self
Source§impl From<ThuliumIsotope> for Element
impl From<ThuliumIsotope> for Element
Source§fn from(_isotope: ThuliumIsotope) -> Self
fn from(_isotope: ThuliumIsotope) -> Self
Source§impl From<TinIsotope> for Element
impl From<TinIsotope> for Element
Source§fn from(_isotope: TinIsotope) -> Self
fn from(_isotope: TinIsotope) -> Self
Source§impl From<TitaniumIsotope> for Element
impl From<TitaniumIsotope> for Element
Source§fn from(_isotope: TitaniumIsotope) -> Self
fn from(_isotope: TitaniumIsotope) -> Self
Source§impl From<TungstenIsotope> for Element
impl From<TungstenIsotope> for Element
Source§fn from(_isotope: TungstenIsotope) -> Self
fn from(_isotope: TungstenIsotope) -> Self
Source§impl From<UraniumIsotope> for Element
impl From<UraniumIsotope> for Element
Source§fn from(_isotope: UraniumIsotope) -> Self
fn from(_isotope: UraniumIsotope) -> Self
Source§impl From<VanadiumIsotope> for Element
impl From<VanadiumIsotope> for Element
Source§fn from(_isotope: VanadiumIsotope) -> Self
fn from(_isotope: VanadiumIsotope) -> Self
Source§impl From<XenonIsotope> for Element
impl From<XenonIsotope> for Element
Source§fn from(_isotope: XenonIsotope) -> Self
fn from(_isotope: XenonIsotope) -> Self
Source§impl From<YtterbiumIsotope> for Element
impl From<YtterbiumIsotope> for Element
Source§fn from(_isotope: YtterbiumIsotope) -> Self
fn from(_isotope: YtterbiumIsotope) -> Self
Source§impl From<YttriumIsotope> for Element
impl From<YttriumIsotope> for Element
Source§fn from(_isotope: YttriumIsotope) -> Self
fn from(_isotope: YttriumIsotope) -> Self
Source§impl From<ZincIsotope> for Element
impl From<ZincIsotope> for Element
Source§fn from(_isotope: ZincIsotope) -> Self
fn from(_isotope: ZincIsotope) -> Self
Source§impl From<ZirconiumIsotope> for Element
impl From<ZirconiumIsotope> for Element
Source§fn from(_isotope: ZirconiumIsotope) -> Self
fn from(_isotope: ZirconiumIsotope) -> Self
Source§impl FromIterator<Element> for ElementMask
impl FromIterator<Element> for ElementMask
Source§fn from_iter<T: IntoIterator<Item = Element>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = Element>>(iter: T) -> Self
§Examples
use elements_rs::{Element, ElementMask};
let elements = alloc::vec![Element::H, Element::He];
let mask: ElementMask = elements.into_iter().collect();
assert!(mask.contains(Element::H));
assert!(mask.contains(Element::He));Source§impl FromStr for Element
impl FromStr for Element
Source§fn from_str(value: &str) -> Result<Self, Self::Err>
fn from_str(value: &str) -> Result<Self, Self::Err>
Parses an element from its symbol string.
Parses element symbols into Element variants.
§Examples
use elements_rs::Element;
let hydrogen: Element = "H".parse().unwrap();
assert_eq!(hydrogen, Element::H);
let oxygen: Element = "O".parse().unwrap();
assert_eq!(oxygen, Element::O);
let carbon: Element = "C".parse().unwrap();
assert_eq!(carbon, Element::C);Source§impl IntoEnumIterator for Element
impl IntoEnumIterator for Element
type Iterator = ElementIter
fn iter() -> ElementIter ⓘ
Source§impl IsotopicComposition for Element
impl IsotopicComposition for Element
Source§impl Ord for Element
impl Ord for Element
Source§impl PartialOrd for Element
impl PartialOrd for Element
Source§impl PrincipalQuantumNumber for Element
impl PrincipalQuantumNumber for Element
Source§fn principal_quantum_number(&self) -> u8
fn principal_quantum_number(&self) -> u8
Source§impl RelativeAtomicMass for Element
impl RelativeAtomicMass for Element
Source§fn relative_atomic_mass(&self) -> f64
fn relative_atomic_mass(&self) -> f64
Source§impl TryFrom<&str> for Element
impl TryFrom<&str> for Element
Source§fn try_from(value: &str) -> Result<Self, Self::Error>
fn try_from(value: &str) -> Result<Self, Self::Error>
Parses element symbols from string slices.
§Examples
use elements_rs::Element;
let oxygen = Element::try_from("O").unwrap();
assert_eq!(oxygen, Element::O);
let magnesium = Element::try_from("Mg").unwrap();
assert_eq!(magnesium, Element::Mg);Source§impl TryFrom<[char; 2]> for Element
impl TryFrom<[char; 2]> for Element
Source§fn try_from(value: [char; 2]) -> Result<Self, Self::Error>
fn try_from(value: [char; 2]) -> Result<Self, Self::Error>
Parses two-character element symbols.
§Examples
use elements_rs::Element;
let helium = Element::try_from(['H', 'e']).unwrap();
assert_eq!(helium, Element::He);
let lithium = Element::try_from(['L', 'i']).unwrap();
assert_eq!(lithium, Element::Li);Source§impl TryFrom<Element> for [char; 2]
impl TryFrom<Element> for [char; 2]
Source§fn try_from(value: Element) -> Result<Self, Self::Error>
fn try_from(value: Element) -> Result<Self, Self::Error>
Converts an element to its symbol as a character array.
Single-character symbols are padded with a space.
§Examples
use elements_rs::Element;
let hydrogen_chars: [char; 2] = Element::H.try_into().unwrap();
assert_eq!(hydrogen_chars, ['H', ' ']);
let helium_chars: [char; 2] = Element::He.try_into().unwrap();
assert_eq!(helium_chars, ['H', 'e']);Source§impl TryFrom<Element> for char
impl TryFrom<Element> for char
Source§fn try_from(value: Element) -> Result<Self, Self::Error>
fn try_from(value: Element) -> Result<Self, Self::Error>
Converts an element to its single-character symbol.
This only works for elements with single-character symbols. For elements with two-character symbols, this returns an error.
§Examples
use elements_rs::Element;
let hydrogen_char: char = Element::H.try_into().unwrap();
assert_eq!(hydrogen_char, 'H');
let carbon_char: char = Element::C.try_into().unwrap();
assert_eq!(carbon_char, 'C');
// This will fail for two-character symbols
let helium_result: Result<char, _> = Element::He.try_into();
assert!(helium_result.is_err());Source§impl TryFrom<char> for Element
impl TryFrom<char> for Element
Source§fn try_from(value: char) -> Result<Self, Self::Error>
fn try_from(value: char) -> Result<Self, Self::Error>
Parses single-character element symbols.
§Implementation details
It supports both uppercase and lowercase letters since, while in chemical formulas element symbols are capitalized, in other contexts such as SMILES strings they may appear in lowercase to represent aromatic atoms.
§Examples
use elements_rs::Element;
let hydrogen = Element::try_from('H').unwrap();
assert_eq!(hydrogen, Element::H);
let carbon = Element::try_from('C').unwrap();
assert_eq!(carbon, Element::C);