pub enum LadduPhysicsError {
ConversionError(&'static str),
ParseError {
name: String,
object: String,
},
MissingParticleProperty {
property: &'static str,
},
InvalidValue {
name: String,
expected: String,
actual: String,
},
InvalidLength {
name: String,
expected: String,
actual: String,
},
InvalidRelation {
relation: String,
},
UnsupportedValue {
name: String,
supported: String,
actual: String,
},
NumericOverflow {
operation: String,
},
Custom(String),
}Expand description
Errors raised while constructing or evaluating physics objects.
Variants§
ConversionError(&'static str)
An error that should be used to convert TryFrom to LadduPhysicsError.
ParseError
An error which occurs when the user tries to parse an invalid string of text, typically into an enum variant.
Fields
MissingParticleProperty
A particle is missing the requested property
InvalidValue
A single value violates a domain constraint.
Fields
InvalidLength
A collection length or shape is invalid.
Fields
InvalidRelation
A relation between multiple values, quantum numbers, or particle properties is invalid.
UnsupportedValue
A value is valid in principle but not implemented/supported here.
Fields
NumericOverflow
An integer operation overflowed.
Custom(String)
A free-form error message for internal compatibility paths.
Implementations§
Source§impl LadduPhysicsError
impl LadduPhysicsError
Sourcepub fn invalid_value(
name: impl Into<String>,
expected: impl Into<String>,
actual: impl ToString,
) -> Self
pub fn invalid_value( name: impl Into<String>, expected: impl Into<String>, actual: impl ToString, ) -> Self
Construct an invalid-value error.
Sourcepub fn invalid_length(
name: impl Into<String>,
expected: impl Into<String>,
actual: impl ToString,
) -> Self
pub fn invalid_length( name: impl Into<String>, expected: impl Into<String>, actual: impl ToString, ) -> Self
Construct an invalid-length or shape error.
Sourcepub fn invalid_relation(relation: impl Into<String>) -> Self
pub fn invalid_relation(relation: impl Into<String>) -> Self
Construct an invalid-relation error.
Sourcepub fn unsupported_value(
name: impl Into<String>,
supported: impl Into<String>,
actual: impl ToString,
) -> Self
pub fn unsupported_value( name: impl Into<String>, supported: impl Into<String>, actual: impl ToString, ) -> Self
Construct an unsupported-value error.
Sourcepub fn numeric_overflow(operation: impl Into<String>) -> Self
pub fn numeric_overflow(operation: impl Into<String>) -> Self
Construct a numeric-overflow error.
Trait Implementations§
Source§impl Clone for LadduPhysicsError
impl Clone for LadduPhysicsError
Source§fn clone(&self) -> LadduPhysicsError
fn clone(&self) -> LadduPhysicsError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LadduPhysicsError
impl Debug for LadduPhysicsError
Source§impl Display for LadduPhysicsError
impl Display for LadduPhysicsError
Source§impl Error for LadduPhysicsError
impl Error for LadduPhysicsError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for LadduPhysicsError
impl RefUnwindSafe for LadduPhysicsError
impl Send for LadduPhysicsError
impl Sync for LadduPhysicsError
impl Unpin for LadduPhysicsError
impl UnsafeUnpin for LadduPhysicsError
impl UnwindSafe for LadduPhysicsError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.