pub enum MaterialError {
Empty,
UnknownAtomicNumber(u8),
UnknownSymbol(String),
DuplicateElement(u8),
InvalidFraction {
z: u8,
value: f64,
},
NotNormalizable(f64),
InvalidDensity(f64),
MissingDensity,
InvalidEnergy {
z: u8,
kind: EnergyKind,
value: f64,
},
ElementNotInMaterial(u8),
EnergyNotSet {
z: u8,
kind: EnergyKind,
},
InvalidSpec(String),
}Expand description
Errors from building or querying a Material.
Variants§
Empty
No elements were given.
UnknownAtomicNumber(u8)
Atomic number outside 1..=92.
UnknownSymbol(String)
Symbol not in the element table.
DuplicateElement(u8)
The same element appeared twice.
InvalidFraction
A fraction was negative, NaN or infinite.
NotNormalizable(f64)
Fractions sum to zero or to a non-finite value, so cannot be normalised.
InvalidDensity(f64)
A density was zero, negative or not finite.
MissingDensity
No density given and none can be inferred (compound, or element with no tabulated solid density).
InvalidEnergy
An energy was negative, NaN or infinite.
ElementNotInMaterial(u8)
The element is not part of the material.
EnergyNotSet
No default exists for this energy and the user has not set one.
InvalidSpec(String)
A serialized element entry was malformed (spec level problems).
Trait Implementations§
Source§impl Clone for MaterialError
impl Clone for MaterialError
Source§fn clone(&self) -> MaterialError
fn clone(&self) -> MaterialError
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 MaterialError
impl Debug for MaterialError
Source§impl Display for MaterialError
impl Display for MaterialError
Source§impl Error for MaterialError
impl Error for MaterialError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<MaterialError> for ElasticTableError
impl From<MaterialError> for ElasticTableError
Source§fn from(source: MaterialError) -> Self
fn from(source: MaterialError) -> Self
Converts to this type from the input type.
Source§impl From<MaterialError> for DynamicError
impl From<MaterialError> for DynamicError
Source§fn from(source: MaterialError) -> Self
fn from(source: MaterialError) -> Self
Converts to this type from the input type.
Source§impl From<MaterialError> for StoppingError
impl From<MaterialError> for StoppingError
Source§fn from(source: MaterialError) -> Self
fn from(source: MaterialError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for MaterialError
impl PartialEq for MaterialError
impl StructuralPartialEq for MaterialError
Auto Trait Implementations§
impl Freeze for MaterialError
impl RefUnwindSafe for MaterialError
impl Send for MaterialError
impl Sync for MaterialError
impl Unpin for MaterialError
impl UnsafeUnpin for MaterialError
impl UnwindSafe for MaterialError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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