#[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
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
impl FlightPlan
Sourcepub fn from_fpl_bytes(bytes: &[u8]) -> Result<Self, FplError>
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.
Sourcepub fn to_fpl_string(&self) -> String
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.
Sourcepub fn destination(&self) -> Option<&str>
pub fn destination(&self) -> Option<&str>
The destination identifier (last route point).
The route as NavPoints, for snapshot-free resolution or
display.
Sourcepub fn to_expanded_route(&self) -> ExpandedRoute
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.
Sourcepub fn to_route_briefing_request(
&self,
corridor_half_width_nm: f64,
flight_rules: FlightRules,
) -> RouteBriefingRequest
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
impl Clone for FlightPlan
Source§fn clone(&self) -> FlightPlan
fn clone(&self) -> FlightPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FlightPlan
impl Debug for FlightPlan
Source§impl Default for FlightPlan
impl Default for FlightPlan
Source§fn default() -> FlightPlan
fn default() -> FlightPlan
Source§impl PartialEq for FlightPlan
impl PartialEq for FlightPlan
Source§fn eq(&self, other: &FlightPlan) -> bool
fn eq(&self, other: &FlightPlan) -> bool
self and other values to be equal, and is used by ==.