#[non_exhaustive]pub enum FlightMode {
Copter,
Plane,
ToPlane,
ToCopter,
}Expand description
The regime guidance is actually flying, including the transitions between regimes. Owned
by Guidance and reported in a FlightModeReport.
Not to be confused with ControlMode, the kind of the commanded ControlInput: the
input says what to fly, the flight mode how it’s being flown.
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.
Copter
Flying in FlightRegime::Copter.
Plane
Flying in FlightRegime::Plane.
ToPlane
Transitioning from copter to plane flight.
ToCopter
Transitioning from plane to copter flight.
Implementations§
Source§impl FlightMode
impl FlightMode
Sourcepub fn target(&self) -> FlightRegime
pub fn target(&self) -> FlightRegime
The regime this mode flies in or is heading to.
§Examples
use stable_flight::{FlightMode, FlightRegime};
assert_eq!(FlightMode::ToPlane.target(), FlightRegime::Plane);
assert_eq!(FlightMode::Copter.target(), FlightRegime::Copter);Trait Implementations§
Source§impl Clone for FlightMode
impl Clone for FlightMode
impl Copy for FlightMode
Source§impl Debug for FlightMode
impl Debug for FlightMode
Source§impl Default for FlightMode
impl Default for FlightMode
Source§impl<'de> Deserialize<'de> for FlightMode
impl<'de> Deserialize<'de> for FlightMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for FlightMode
Source§impl PartialEq for FlightMode
impl PartialEq for FlightMode
Source§impl Serialize for FlightMode
impl Serialize for FlightMode
impl StructuralPartialEq for FlightMode
Auto Trait Implementations§
impl Forget for FlightMode
impl Freeze for FlightMode
impl Move for FlightMode
impl RefUnwindSafe for FlightMode
impl Send for FlightMode
impl Sync for FlightMode
impl Unpin for FlightMode
impl UnsafeUnpin for FlightMode
impl UnwindSafe for FlightMode
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
Mutably borrows from an owned value. Read more
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>,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.