Skip to main content

Design

Struct Design 

Source
#[non_exhaustive]
pub struct Design { pub rocket: Rocket, pub motors: Motors, pub recovery: Recovery, pub simulations: Vec<StoredSimulation>, pub extensions: Extensions, }
Expand description

A .ork design read whole: its rocket, carrying every motor configuration hpr can fly as written, and everything the file says about its motors.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§rocket: Rocket

The rocket, as rocket reads it, with Rocket::configurations holding the configurations in Design::motors that were not left out, each motor lit as the file says. A configuration whose MotorConfiguration::staging is set must be flown with that separation (hpr::ork::separation): without it the stack carries its booster to the ground with the sustainer lit on it.

§motors: Motors

Every motor configuration in the file, flown or not.

§recovery: Recovery

When each parachute and streamer opens and each stage separates.

§simulations: Vec<StoredSimulation>

The simulations OpenRocket last ran on the design, with their conditions and results.

§extensions: Extensions

What the file holds that hpr does not model, kept whole for an export to put back.

Implementations§

Source§

impl Design

Source

pub fn new( rocket: Rocket, motors: Motors, recovery: Recovery, simulations: Vec<StoredSimulation>, extensions: Extensions, ) -> Self

A design from its parts, as the hpr design format holds them (hpr_format::DesignFile).

Source

pub fn is_reduced(&self) -> bool

Whether the rocket is reduced: the file describes parts of it (a pod, a parallel stage, a part hpr cannot shape) that are kept in Design::extensions rather than read into it.

The flag is on the Design, not on Design::rocket: check it before using the rocket on its own. A part read as something simpler, such as a cluster of tubes read as one, does not make a design reduced; its warning keeps every configuration of it from flying (ADR-055, the rule for which configurations fly).

Source

pub fn reference_exclusion( &self, simulation: &StoredSimulation, ) -> Option<StoredReferenceExclusion>

Returns why simulation cannot be used as a reference for this design.

This combines the stored-result screen with hpr’s design-reproduction screen. Use StoredSimulation::reference_exclusion and Self::reproduction_exclusion separately when those two questions need to be reported independently.

Source

pub fn reproduction_exclusion( &self, simulation: &StoredSimulation, ) -> Option<StoredReferenceExclusion>

Returns why hpr cannot reproduce the design named by a stored launch configuration.

This is deliberately separate from StoredSimulation::reference_exclusion: a complete OpenRocket result can be a useful stored reference even when hpr does not yet have its motor curve or full airframe model. A caller that needs a result hpr can fly should apply both classifiers.

Trait Implementations§

Source§

impl Clone for Design

Source§

fn clone(&self) -> Design

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Design

Source§

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

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

impl<'de> Deserialize<'de> for Design

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Design

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Design

Source§

fn eq(&self, other: &Design) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Design

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Design

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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.

§

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.