#[non_exhaustive]pub struct Device {
pub name: String,
pub drag: DeviceDrag,
pub trigger: Trigger,
pub lag_s: f64,
pub inflation: Inflation,
pub released_by: Option<usize>,
pub body: usize,
}Expand description
A recovery device: a drag area, when it opens, and how it fills.
Build one with Device::new and the builders: the struct is #[non_exhaustive] so that
streamers (M1.7b) and separation (M1.7c) can add fields without breaking
callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringA name for reports.
drag: DeviceDragWhat gives it its drag area.
trigger: TriggerWhen its charge fires.
lag_s: f64Seconds from the trigger to line stretch, when the canopy starts to fill (RocketPy’s
lag).
inflation: InflationHow its drag area grows from line stretch.
released_by: Option<usize>The device whose opening releases this one, by its index in the flight’s list: a drogue cut away once the main is fully open. A device released before its own charge fires never deploys.
body: usizeWhich body it is attached to, after a separation (Separation) or an ejection
(crate::Ejection): body 0 keeps the nose, body 1 is the separation’s aft stages, and each
ejection’s piece the next number, in the order given, so with no separation the first
ejection makes body 1. Without either there is only body 0.
Implementations§
Source§impl Device
impl Device
Sourcepub fn new(
name: impl Into<String>,
drag: DeviceDrag,
trigger: Trigger,
) -> Device
pub fn new( name: impl Into<String>, drag: DeviceDrag, trigger: Trigger, ) -> Device
A device with no lag, opening at once and never released.
Sourcepub fn with_lag_s(self, lag_s: f64) -> Device
pub fn with_lag_s(self, lag_s: f64) -> Device
The same device with lag_s seconds from the trigger to line stretch.
Sourcepub fn with_inflation(self, inflation: Inflation) -> Device
pub fn with_inflation(self, inflation: Inflation) -> Device
The same device with an inflation law.
Sourcepub fn with_release_by(self, index: usize) -> Device
pub fn with_release_by(self, index: usize) -> Device
The same device, released when device index is fully open.
Sourcepub fn on_body(self, index: usize) -> Device
pub fn on_body(self, index: usize) -> Device
The same device, carried by body index after a separation (Separation) or an
ejection (crate::Ejection); Self::body has the numbering. It acts only once that
body flies on its own.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Device
impl<'de> Deserialize<'de> for Device
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Device, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Device, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Device
impl Serialize for Device
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Device
Auto Trait Implementations§
impl Freeze for Device
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnsafeUnpin for Device
impl UnwindSafe for Device
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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