#[non_exhaustive]pub enum MotorError {
Domain {
what: &'static str,
value: f64,
},
Parse {
what: &'static str,
text: String,
},
NoThrust,
TimesDecreasing {
index: usize,
time_s: f64,
},
Syntax {
format: &'static str,
line: usize,
message: String,
},
Catalog(String),
Inconsistent(String),
}Expand description
An error from the motor crate: a value outside a model’s domain, a thrust curve or motor that can’t be built, or a motor file that can’t be read.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Domain
An input outside a model’s domain, such as a negative mass or a non-finite time.
Parse
Text that doesn’t parse as the value it should hold.
NoThrust
A thrust curve needs positive total impulse and a positive NFPA 1125 burn time.
TimesDecreasing
Thrust-curve times must not decrease.
Fields
Syntax
A motor file is malformed.
Fields
Catalog(String)
A motor catalog index that doesn’t deserialize.
Inconsistent(String)
Masses or geometry that contradict each other, such as a propellant mass above the total mass, or grains that don’t fit.
Trait Implementations§
Source§impl Clone for MotorError
impl Clone for MotorError
Source§fn clone(&self) -> MotorError
fn clone(&self) -> MotorError
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 MotorError
impl Debug for MotorError
Source§impl Display for MotorError
impl Display for MotorError
Source§impl Error for MotorError
impl Error for MotorError
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 PartialEq for MotorError
impl PartialEq for MotorError
Source§fn eq(&self, other: &MotorError) -> bool
fn eq(&self, other: &MotorError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MotorError
Auto Trait Implementations§
impl Freeze for MotorError
impl RefUnwindSafe for MotorError
impl Send for MotorError
impl Sync for MotorError
impl Unpin for MotorError
impl UnsafeUnpin for MotorError
impl UnwindSafe for MotorError
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