Enum RadType
pub enum RadType {
Alpha,
BetaPlus,
BetaMinus,
Gamma,
Electron,
Xray,
}
Expand description
Type of decay radiation
The IAEA chart of nuclides contains data for the following types:
- Alpha (
a
) - Beta+ or electron capture (
bp
) - Beta- (
bm
) - Gamma decay (
g
) - Auger and conversion electron (
e
) - X-ray (
x
)
This enum collects them together for simple and explicit requests.
The FromStr
trait is implemented for all radiation types for easy
conversuion between the variants and their symbols required by the IAEA API.
// Get the variant from an IAEA symbol
assert_eq!(RadType::from_str("a").unwrap(), RadType::Alpha);
Of course, the reverse is also available if the symbol is required:
// Get the IAEA symbol for a variant
assert_eq!(RadType::Alpha.query_symbol(), "a");
Variants§
Alpha
Alpha decay (a
)
BetaPlus
Beta+ or electron capture (bp
)
BetaMinus
Beta- (bm
)
Gamma
Gamma decay (g
)
Electron
Auger and conversion electron (e
)
Xray
X-ray (x
)
Implementations§
§impl RadType
impl RadType
pub fn query_symbol(&self) -> &str
pub fn query_symbol(&self) -> &str
Get corresponding API symbol for a variant
For example:
// Get the IAEA symbol for a variant
assert_eq!(RadType::Alpha.query_symbol(), "a");
assert_eq!(RadType::BetaMinus.query_symbol(), "bm");
assert_eq!(RadType::BetaPlus.query_symbol(), "bp");
assert_eq!(RadType::Gamma.query_symbol(), "g");
assert_eq!(RadType::Electron.query_symbol(), "e");
assert_eq!(RadType::Xray.query_symbol(), "x");
Trait Implementations§
§impl Ord for RadType
impl Ord for RadType
§impl PartialOrd for RadType
impl PartialOrd for RadType
impl Copy for RadType
impl Eq for RadType
impl StructuralPartialEq for RadType
Auto Trait Implementations§
impl Freeze for RadType
impl RefUnwindSafe for RadType
impl Send for RadType
impl Sync for RadType
impl Unpin for RadType
impl UnwindSafe for RadType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.