Skip to main content

Element

Enum Element 

Source
#[repr(u8)]
pub enum Element {
Show 118 variants H = 1, He = 2, Li = 3, Be = 4, B = 5, C = 6, N = 7, O = 8, F = 9, Ne = 10, Na = 11, Mg = 12, Al = 13, Si = 14, P = 15, S = 16, Cl = 17, Ar = 18, K = 19, Ca = 20, Sc = 21, Ti = 22, V = 23, Cr = 24, Mn = 25, Fe = 26, Co = 27, Ni = 28, Cu = 29, Zn = 30, Ga = 31, Ge = 32, As = 33, Se = 34, Br = 35, Kr = 36, Rb = 37, Sr = 38, Y = 39, Zr = 40, Nb = 41, Mo = 42, Tc = 43, Ru = 44, Rh = 45, Pd = 46, Ag = 47, Cd = 48, In = 49, Sn = 50, Sb = 51, Te = 52, I = 53, Xe = 54, Cs = 55, Ba = 56, La = 57, Ce = 58, Pr = 59, Nd = 60, Pm = 61, Sm = 62, Eu = 63, Gd = 64, Tb = 65, Dy = 66, Ho = 67, Er = 68, Tm = 69, Yb = 70, Lu = 71, Hf = 72, Ta = 73, W = 74, Re = 75, Os = 76, Ir = 77, Pt = 78, Au = 79, Hg = 80, Tl = 81, Pb = 82, Bi = 83, Po = 84, At = 85, Rn = 86, Fr = 87, Ra = 88, Ac = 89, Th = 90, Pa = 91, U = 92, Np = 93, Pu = 94, Am = 95, Cm = 96, Bk = 97, Cf = 98, Es = 99, Fm = 100, Md = 101, No = 102, Lr = 103, Rf = 104, Db = 105, Sg = 106, Bh = 107, Hs = 108, Mt = 109, Ds = 110, Rg = 111, Cn = 112, Nh = 113, Fl = 114, Mc = 115, Lv = 116, Ts = 117, Og = 118,
}
Expand description

Chemical element with complete periodic table (elements 1-118)

Variants§

§

H = 1

§

He = 2

§

Li = 3

§

Be = 4

§

B = 5

§

C = 6

§

N = 7

§

O = 8

§

F = 9

§

Ne = 10

§

Na = 11

§

Mg = 12

§

Al = 13

§

Si = 14

§

P = 15

§

S = 16

§

Cl = 17

§

Ar = 18

§

K = 19

§

Ca = 20

§

Sc = 21

§

Ti = 22

§

V = 23

§

Cr = 24

§

Mn = 25

§

Fe = 26

§

Co = 27

§

Ni = 28

§

Cu = 29

§

Zn = 30

§

Ga = 31

§

Ge = 32

§

As = 33

§

Se = 34

§

Br = 35

§

Kr = 36

§

Rb = 37

§

Sr = 38

§

Y = 39

§

Zr = 40

§

Nb = 41

§

Mo = 42

§

Tc = 43

§

Ru = 44

§

Rh = 45

§

Pd = 46

§

Ag = 47

§

Cd = 48

§

In = 49

§

Sn = 50

§

Sb = 51

§

Te = 52

§

I = 53

§

Xe = 54

§

Cs = 55

§

Ba = 56

§

La = 57

§

Ce = 58

§

Pr = 59

§

Nd = 60

§

Pm = 61

§

Sm = 62

§

Eu = 63

§

Gd = 64

§

Tb = 65

§

Dy = 66

§

Ho = 67

§

Er = 68

§

Tm = 69

§

Yb = 70

§

Lu = 71

§

Hf = 72

§

Ta = 73

§

W = 74

§

Re = 75

§

Os = 76

§

Ir = 77

§

Pt = 78

§

Au = 79

§

Hg = 80

§

Tl = 81

§

Pb = 82

§

Bi = 83

§

Po = 84

§

At = 85

§

Rn = 86

§

Fr = 87

§

Ra = 88

§

Ac = 89

§

Th = 90

§

Pa = 91

§

U = 92

§

Np = 93

§

Pu = 94

§

Am = 95

§

Cm = 96

§

Bk = 97

§

Cf = 98

§

Es = 99

§

Fm = 100

§

Md = 101

§

No = 102

§

Lr = 103

§

Rf = 104

§

Db = 105

§

Sg = 106

§

Bh = 107

§

Hs = 108

§

Mt = 109

§

Ds = 110

§

Rg = 111

§

Cn = 112

§

Nh = 113

§

Fl = 114

§

Mc = 115

§

Lv = 116

§

Ts = 117

§

Og = 118

Implementations§

Source§

impl Element

Source

pub const ALL: &'static [Element]

All supported elements (1-118)

Source

pub const fn z(self) -> u8

Atomic number (Z)

Source

pub fn symbol(self) -> &'static str

Chemical symbol (e.g., “H”, “C”, “Fe”)

Source

pub fn name(self) -> &'static str

English element name

Source

pub fn atomic_mass(self) -> f32

Standard atomic mass (in atomic mass units)

Source

pub fn covalent_radius(self) -> f32

Covalent radius (in Angstroms)

Source

pub fn vdw_radius(self) -> f32

Van der Waals radius (in Angstroms)

Source

pub fn by_number(z: u8) -> Option<Element>

Lookup by atomic number

Source

pub fn by_symbol(sym: &str) -> Option<Element>

Lookup by symbol (case-insensitive)

Source

pub const fn is_early_atom(self) -> bool

Whether this element sits to the left of carbon in its periodic-table row (group 1, 2 and the group-13 triad B/Al/Ga/…).

RDKit calls these “early” (electron-poor) atoms. The distinction matters for charged-atom valence: an early atom carrying a positive charge has fewer electrons available for bonding, while a late atom (N, O, F …) carrying a negative charge gains a lone pair it can protonate. Both are captured exactly by the effective_atomic_number shift below, so this predicate is exposed mainly for callers that want the sign explicitly.

Mirrors RDKit::isEarlyAtom (Code/GraphMol/Atom.cpp).

Source

pub fn effective_atomic_number(self, formal_charge: i32) -> Option<Element>

Effective element after folding a formal charge into the proton count, per RDKit’s getEffectiveAtomicNum: Z_eff = Z − formal_charge.

This is the heart of the charged-atom valence rule. A cation borrows the valence list of the element one place earlier in the table; an anion borrows the element one place later. Examples:

  • [CH3+] → Z 6 − (+1) = 5 (B), valence 3 → 3 H
  • [CH3-] → Z 6 − (−1) = 7 (N), valence 3 → 3 H
  • [NH4+] → Z 7 − (+1) = 6 (C), valence 4 → 4 H
  • [BH4-] → Z 5 − (−1) = 6 (C), valence 4 → 4 H
  • [OH-] → Z 8 − (−1) = 9 (F), valence 1 → 1 H
  • [NH2-] → Z 7 − (−1) = 8 (O), valence 2 → 2 H

Returns None when the shift lands outside the table (1..=118).

Mirrors RDKit::getEffectiveAtomicNum (Code/GraphMol/Atom.cpp).

Source

pub fn default_valences(self) -> &'static [u8]

Default allowed valences for this element (ascending order).

Returns the list of typical valences used for implicit hydrogen calculation. The smallest value ≥ current bond-order sum is chosen. Returns &[] for noble gases and elements without standard valences.

Trait Implementations§

Source§

impl Clone for Element

Source§

fn clone(&self) -> Element

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Element

Source§

impl Debug for Element

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for Element

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for Element

Source§

impl FromStr for Element

Source§

type Err = ()

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Element, <Element as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for Element

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Element

Source§

fn eq(&self, other: &Element) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Element

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V