pub struct NuclideNumbers {
pub mass_number: u32,
pub atomic_number: u32,
}Expand description
Mass and atomic numbers for a nuclide.
Fields§
§mass_number: u32Mass number A, equal to total nucleons.
atomic_number: u32Atomic number Z, equal to total protons.
Implementations§
Source§impl NuclideNumbers
impl NuclideNumbers
Sourcepub const fn new(mass_number: u32, atomic_number: u32) -> Option<NuclideNumbers>
pub const fn new(mass_number: u32, atomic_number: u32) -> Option<NuclideNumbers>
Creates validated nuclide numbers.
§Examples
use use_nuclear::NuclideNumbers;
let helium = NuclideNumbers::new(4, 2);
assert_eq!(helium, Some(NuclideNumbers { mass_number: 4, atomic_number: 2 }));Sourcepub const fn proton_count(&self) -> u32
pub const fn proton_count(&self) -> u32
Returns the proton count for this nuclide.
Sourcepub const fn neutron_count(&self) -> u32
pub const fn neutron_count(&self) -> u32
Returns the neutron count for this nuclide.
Sourcepub const fn nucleon_count(&self) -> u32
pub const fn nucleon_count(&self) -> u32
Returns the total nucleon count for this nuclide.
Trait Implementations§
Source§impl Clone for NuclideNumbers
impl Clone for NuclideNumbers
Source§fn clone(&self) -> NuclideNumbers
fn clone(&self) -> NuclideNumbers
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NuclideNumbers
impl Debug for NuclideNumbers
Source§impl PartialEq for NuclideNumbers
impl PartialEq for NuclideNumbers
Source§fn eq(&self, other: &NuclideNumbers) -> bool
fn eq(&self, other: &NuclideNumbers) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for NuclideNumbers
impl Eq for NuclideNumbers
impl StructuralPartialEq for NuclideNumbers
Auto Trait Implementations§
impl Freeze for NuclideNumbers
impl RefUnwindSafe for NuclideNumbers
impl Send for NuclideNumbers
impl Sync for NuclideNumbers
impl Unpin for NuclideNumbers
impl UnsafeUnpin for NuclideNumbers
impl UnwindSafe for NuclideNumbers
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