Struct NuclideNumbers
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§
§impl NuclideNumbers
impl NuclideNumbers
pub 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 }));pub const fn proton_count(&self) -> u32
pub const fn proton_count(&self) -> u32
Returns the proton count for this nuclide.
pub const fn neutron_count(&self) -> u32
pub const fn neutron_count(&self) -> u32
Returns the neutron count for this nuclide.
pub const fn nucleon_count(&self) -> u32
pub const fn nucleon_count(&self) -> u32
Returns the total nucleon count for this nuclide.
Trait Implementations§
§impl Clone for NuclideNumbers
impl Clone for NuclideNumbers
§fn clone(&self) -> NuclideNumbers
fn clone(&self) -> NuclideNumbers
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for NuclideNumbers
impl Debug for NuclideNumbers
§impl PartialEq for NuclideNumbers
impl PartialEq for NuclideNumbers
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