Skip to main content

Trigger

Enum Trigger 

Source
#[non_exhaustive]
pub enum Trigger { Apogee, Altitude { height_above_ground_m: f64, }, Time { time_s: f64, }, MotorDelay { motor: usize, }, Burnout { motor: usize, delay_s: f64, }, }
Expand description

When a device’s charge fires.

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.
§

Apogee

At apogee.

§

Altitude

The first time from apogee that the center of mass is at or below this height above the launch site, m: an altimeter’s main setting. A rocket whose apogee is already below it fires at apogee.

Fields

§height_above_ground_m: f64

The height above the launch site, m.

§

Time

At a time after launch, s. Charges are checked in free flight and during the descent, so a time that passes on the pad or the rail fires at rail exit.

Fields

§time_s: f64

The time after launch, s.

§

MotorDelay

A motor’s ejection delay after that motor’s burnout. The motor is its index in hpr_design::Assembly::motors, and it must have a hpr_motor::Delay::Seconds delay. As Self::Time, a delay that expires before the rail exit fires there. A motor that never lights never fires it, so on a cluster with a motor out (hpr_design::MountedMotor::failed_tubes) name a tube that lights.

Fields

§motor: usize

The motor’s index.

§

Burnout

A delay after a motor’s burnout, whatever its ejection delay: a stage separation timed from the booster’s burnout. The motor is its index in hpr_design::Assembly::motors. As Self::MotorDelay, it fires no earlier than the rail exit, and never if the motor never lights.

Fields

§motor: usize

The motor’s index.

§delay_s: f64

The delay after its burnout, s.

Implementations§

Source§

impl Trigger

Source

pub fn known_time_s(self, assembly: &Assembly) -> Result<Option<f64>, SimError>

When it fires on a flight of assembly, if that is known before the flight: a Self::Time, or a delay after the burnout of a motor assembly lights at a known time (one lit by a separation has none yet). None for Self::Apogee and Self::Altitude, which the flight watches for. A time that passes on the pad or the rail fires at the rail exit in flight, which this does not know.

§Errors

SimError::Domain as the flight refuses the trigger: a time before launch, a motor that isn’t there, a Self::MotorDelay on a motor with no ejection delay in seconds, or a delay that is negative or not finite.

Trait Implementations§

Source§

impl Clone for Trigger

Source§

fn clone(&self) -> Trigger

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 Copy for Trigger

Source§

impl Debug for Trigger

Source§

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

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

impl<'de> Deserialize<'de> for Trigger

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 PartialEq for Trigger

Source§

fn eq(&self, other: &Trigger) -> 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 Trigger

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 Trigger

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
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.

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.