Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 17 variants Domain { what: &'static str, value: f64, }, Order(Order), UnknownMaterial(String), NoSuchMotor(String), AmbiguousMotor { name: String, candidates: Vec<String>, }, EmptyDesignation, MotorCount(usize), NoMotor, NoSuchConfiguration(String), DesignChecks(Vec<Finding>), Catalog { part: String, problem: CatalogProblem, }, Design(DesignError), Motor(MotorError), Sim(SimError), Aero(AeroError), Atmos(AtmosError), Core(CoreError),
}
Expand description

Anything the builder API can refuse: its own checks, and every error of the crates it calls.

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

A number outside its domain, such as a negative length or a NaN, found as it was given.

Fields

§what: &'static str

What the number is.

§value: f64

The number.

§

Order(Order)

Parts added in an order the rocket can’t be built in, such as fins before any body tube.

§

UnknownMaterial(String)

A material id that isn’t built in; hpr_design::materials lists them.

§

NoSuchMotor(String)

No motor with a thrust curve in the bundled catalog matches the name.

§

AmbiguousMotor

Several different motors match the name. Each is listed by its designation, which finds it alone, then its manufacturer: I175WS (AeroTech).

Fields

§name: String

The name asked for.

§candidates: Vec<String>

The motors it matches.

§

EmptyDesignation

A motor with an empty designation, which the design would take as a duplicate id.

§

MotorCount(usize)

A motor file holds no motor, or more than one where one was expected.

§

NoMotor

A flight of a rocket with no motor: give it one with crate::Rocket::set_motor.

§

NoSuchConfiguration(String)

A configuration id the design doesn’t hold.

§

DesignChecks(Vec<Finding>)

The design’s checks (hpr_design::checks) found errors: every finding, errors and warnings, in the checks’ order.

§

Catalog

A catalog part the builder can’t make into the part asked for.

Fields

§part: String

The part: its maker and part number, and its file.

§problem: CatalogProblem

What is wrong with it.

§

Design(DesignError)

From the design: its tree, parts and mass properties.

§

Motor(MotorError)

From the motor models and motor files.

§

Sim(SimError)

From the flight simulation.

§

Aero(AeroError)

From the aerodynamic model.

§

Atmos(AtmosError)

From the atmosphere and wind models.

§

Core(CoreError)

From the geodesy: a launch site that isn’t on the Earth.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<AeroError> for Error

Source§

fn from(source: AeroError) -> Self

Converts to this type from the input type.
Source§

impl From<AtmosError> for Error

Source§

fn from(source: AtmosError) -> Self

Converts to this type from the input type.
Source§

impl From<CoreError> for Error

Source§

fn from(source: CoreError) -> Self

Converts to this type from the input type.
Source§

impl From<DesignError> for Error

Source§

fn from(source: DesignError) -> Self

Converts to this type from the input type.
Source§

impl From<MotorError> for Error

Source§

fn from(source: MotorError) -> Self

Converts to this type from the input type.
Source§

impl From<SimError> for Error

Source§

fn from(source: SimError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.