Skip to main content

FlightPlan

Struct FlightPlan 

Source
#[non_exhaustive]
pub struct FlightPlan { pub name: Option<String>, pub created: Option<DateTime<Utc>>, pub etd: Option<DateTime<Utc>>, pub cruise_altitude_ft: Option<i32>, pub aircraft_tail: Option<String>, pub route: Vec<PlanWaypoint>, }
Expand description

An imported Garmin flight plan: ordered route plus the metadata other tools attach.

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.
§name: Option<String>

<route-name>, when present.

§created: Option<DateTime<Utc>>

<created> timestamp.

§etd: Option<DateTime<Utc>>

Estimated time of departure (<flight-data><etd-zulu>).

§cruise_altitude_ft: Option<i32>

Planned cruise altitude in feet (<flight-data><altitude-ft>).

§aircraft_tail: Option<String>

Aircraft tail number (<aircraft><aircraft-tailnumber>).

§route: Vec<PlanWaypoint>

Ordered route waypoints, departure first, destination last.

Implementations§

Source§

impl FlightPlan

Source

pub fn from_fpl_bytes(bytes: &[u8]) -> Result<Self, FplError>

Parse a Garmin .fpl document. Accepts UTF-16 (with BOM, as ForeFlight exports) or UTF-8.

Source

pub fn to_fpl_string(&self) -> String

Serialize to a Garmin .fpl document (UTF-8), in the widely accepted ForeFlight dialect: a <waypoint-table> dictionary, an ordered <route>, and a <flight-data> block carrying ETD and cruise altitude.

Source

pub fn departure(&self) -> Option<&str>

The departure identifier (first route point).

Source

pub fn destination(&self) -> Option<&str>

The destination identifier (last route point).

Source

pub fn nav_points(&self) -> Vec<NavPoint>

The route as NavPoints, for snapshot-free resolution or display.

Source

pub fn to_expanded_route(&self) -> ExpandedRoute

The route as an ExpandedRoute — the .fpl already carries every position, so this needs no navdata snapshot and feeds Corridor::around_route directly.

Source

pub fn to_route_briefing_request( &self, corridor_half_width_nm: f64, flight_rules: FlightRules, ) -> RouteBriefingRequest

Build a RouteBriefingRequest over this plan with a corridor_half_width_nm corridor, carrying ETD, cruise altitude, and flight rules so providers compose the right requests.

Trait Implementations§

Source§

impl Clone for FlightPlan

Source§

fn clone(&self) -> FlightPlan

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 FlightPlan

Source§

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

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

impl Default for FlightPlan

Source§

fn default() -> FlightPlan

Returns the “default value” for a type. Read more
Source§

impl PartialEq for FlightPlan

Source§

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

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