pub enum Element {
H,
He,
Li,
// some variants omitted
}Expand description
Each of the known chemical elements
Variants§
Implementations§
Source§impl Element
impl Element
Source§impl Element
impl Element
Sourcepub const fn atomic_number(&self) -> u32
pub const fn atomic_number(&self) -> u32
Returns the element’s atomic number, i.e., the number of protons in its nucleus.
use mendeleev::Element;
assert_eq!(Element::H.atomic_number(), 1);
assert_eq!(Element::Og.atomic_number(), 118);Source§impl Element
impl Element
Sourcepub const fn atomic_radius(&self) -> Option<Picometer>
pub const fn atomic_radius(&self) -> Option<Picometer>
Returns the element’s empirically measured atomic radius, if available.
use mendeleev::{Element, Picometer};
assert_eq!(Element::H.atomic_radius(), Some(Picometer(25.0)));Source§impl Element
impl Element
Sourcepub const fn atomic_weight(&self) -> AtomicWeight
pub const fn atomic_weight(&self) -> AtomicWeight
Returns the element’s Standard Atomic Weight, if applicable, or its mass number otherwise.
use mendeleev::{Element, AtomicWeight};
assert_eq!(Element::H.atomic_weight(),
AtomicWeight::Interval{range: 1.0078..=1.0082, conventional: 1.008});
assert_eq!(Element::Og.atomic_weight(), AtomicWeight::MassNumber{number: 294});Source§impl Element
impl Element
Sourcepub const fn cpk_color(&self) -> Option<Color>
pub const fn cpk_color(&self) -> Option<Color>
Returns the color for the element in the CPK convention.
use mendeleev::{Element, Color};
assert_eq!(Element::H.cpk_color(), Some(Color{r: 255, g: 255, b: 255}));
assert_eq!(Element::Og.cpk_color(), None);
assert_eq!(Element::Au.cpk_color(), Some(Color{r: 218, g: 165, b: 32}));Source§impl Element
impl Element
Sourcepub const fn jmol_color(&self) -> Option<Color>
pub const fn jmol_color(&self) -> Option<Color>
Returns the color for the element in the jmol software
use mendeleev::{Element, Color};
assert_eq!(Element::H.jmol_color(), Some(Color{r: 255, g: 255, b: 255}));
assert_eq!(Element::Og.jmol_color(), None);
assert_eq!(Element::Au.jmol_color(), Some(Color{r: 255, g: 209, b: 35}));Source§impl Element
impl Element
Sourcepub const fn year_discovered(&self) -> YearDiscovered
pub const fn year_discovered(&self) -> YearDiscovered
The year in which the element was discovered, if known.
use mendeleev::{Element, YearDiscovered};
assert_eq!(Element::H.year_discovered(), YearDiscovered::Known(1766));
assert_eq!(Element::Og.year_discovered(), YearDiscovered::Known(2002));
assert_eq!(Element::Au.year_discovered(), YearDiscovered::Ancient);Source§impl Element
impl Element
Sourcepub const fn melting_point(&self) -> Option<Kelvin>
pub const fn melting_point(&self) -> Option<Kelvin>
Returns the element’s melting point, if known.
For some elements that do not melt at atmospheric pressure, the value is given for triple point pressure.
For elements that have multiple allotropes, one of them was chosen arbitrarily for the return value.
use mendeleev::{Element, Kelvin};
assert_eq!(Element::H.melting_point(), Some(Kelvin(13.99)));
// Carbon allotropes have no melting point at standard pressure
assert_eq!(Element::C.melting_point(), None);
// White phosphorus
assert_eq!(Element::P.melting_point(), Some(Kelvin(317.3)));
assert_eq!(Element::Og.melting_point(), None);Source§impl Element
impl Element
Sourcepub const fn boiling_point(&self) -> Option<Kelvin>
pub const fn boiling_point(&self) -> Option<Kelvin>
Returns the element’s boiling point, if known.
For elements that have multiple allotropes, one of them was chosen arbitrarily for the return value.
use mendeleev::{Element, Kelvin};
assert_eq!(Element::H.boiling_point(), Some(Kelvin(20.271)));
// Graphite (sublimation point)
assert_eq!(Element::C.boiling_point(), Some(Kelvin(4098.15)));
// White phosphorus
assert_eq!(Element::P.boiling_point(), Some(Kelvin(553.65)));
assert_eq!(Element::Og.boiling_point(), None);Source§impl Element
impl Element
Sourcepub const fn fusion_heat(&self) -> Option<KiloJoulePerMole>
pub const fn fusion_heat(&self) -> Option<KiloJoulePerMole>
Returns the element’s fusion heat, if known.
use mendeleev::{Element, KiloJoulePerMole};
assert_eq!(Element::H.fusion_heat(), Some(KiloJoulePerMole(0.117)));
assert_eq!(Element::Og.fusion_heat(), None);Source§impl Element
impl Element
Sourcepub const fn evaporation_heat(&self) -> Option<KiloJoulePerMole>
pub const fn evaporation_heat(&self) -> Option<KiloJoulePerMole>
Returns the element’s evaporation heat, if known.
use mendeleev::{Element, KiloJoulePerMole};
assert_eq!(Element::H.evaporation_heat(), Some(KiloJoulePerMole(0.904)));Source§impl Element
impl Element
Sourcepub const fn electronic_configuration(&self) -> ElectronicConfiguration
pub const fn electronic_configuration(&self) -> ElectronicConfiguration
Returns the element’s electronic configuration.
use mendeleev::{Element, SubshellLabel};
let configuration = Element::Li.electronic_configuration();
assert_eq!(configuration.noble_gas, Some(Element::He));
assert_eq!(configuration.valence_subshells[0].shell_number, 2);
assert_eq!(configuration.valence_subshells[0].subshell_label, SubshellLabel::S);
assert_eq!(configuration.valence_subshells[0].number_of_electrons, 1);Source§impl Element
impl Element
Sourcepub const fn discoverers(&self) -> Option<&'static [&'static str]>
pub const fn discoverers(&self) -> Option<&'static [&'static str]>
Returns the persons and/or institutions involved in the discovery of the element, if known.
use mendeleev::Element;
assert_eq!(Element::H.discoverers(), Some(["Henry Cavendish"].as_slice()));
assert_eq!(Element::He.discoverers(), Some(["Sir William Ramsey", "Nils Langet", "P.T.Cleve"].as_slice()));
assert_eq!(Element::Og.discoverers(), Some(["Joint Institute for Nuclear Research"].as_slice()));
assert_eq!(Element::Au.discoverers(), None);Source§impl Element
impl Element
Sourcepub const fn discovery_location(&self) -> Option<&'static [&'static str]>
pub const fn discovery_location(&self) -> Option<&'static [&'static str]>
Returns the location (country, in most cases) where the element was discovered, if known. There can be multiple locations if it was an international effort or if multiple teams discovered or isolated the element independently.
use mendeleev::Element;
assert_eq!(Element::H.discovery_location(), Some(["England"].as_slice()));
assert_eq!(Element::He.discovery_location(), Some(["Scotland", "Sweden"].as_slice()));
assert_eq!(Element::Og.discovery_location(), Some(["Russia"].as_slice()));
assert_eq!(Element::Au.discovery_location(), None);Source§impl Element
impl Element
Sourcepub const fn oxidation_states(
&self,
category: OxidationStateCategory,
) -> &'static [i8]
pub const fn oxidation_states( &self, category: OxidationStateCategory, ) -> &'static [i8]
Returns the element’s oxidation states for the given category.
§Example
use mendeleev::{Element, OxidationStateCategory::{Main, Extended, All}};
assert_eq!(Element::N.oxidation_states(Main), [-3, 3, 5]);
assert_eq!(Element::N.oxidation_states(Extended), [-2, -1, 0, 1, 2, 4]);
assert_eq!(Element::N.oxidation_states(All), [-3, -2, -1, 0, 1, 2, 3, 4, 5]);Source§impl Element
impl Element
Sourcepub const fn density(&self) -> Option<GramPerCubicCentimeter>
pub const fn density(&self) -> Option<GramPerCubicCentimeter>
Returns the element’s density in its most common form, if available.
use mendeleev::{Element, GramPerCubicCentimeter};
assert_eq!(Element::H.density(), Some(GramPerCubicCentimeter(0.00008988)));Source§impl Element
impl Element
Sourcepub const fn electron_affinity(&self) -> Option<Electronvolt>
pub const fn electron_affinity(&self) -> Option<Electronvolt>
Returns the element’s electron affinity, if available.
use mendeleev::{Element, Electronvolt};
assert_eq!(Element::H.electron_affinity(), Some(Electronvolt(0.754)));Source§impl Element
impl Element
Sourcepub const fn ionization_energy(&self) -> Option<Electronvolt>
pub const fn ionization_energy(&self) -> Option<Electronvolt>
Returns the element’s ionization energy, if available.
use mendeleev::{Element, Electronvolt};
assert_eq!(Element::H.ionization_energy(), Some(Electronvolt(13.598)));