#[non_exhaustive]pub enum FailsafeState {
Primary,
Fallback,
AwaitingSticks,
}Expand description
Which commander a FailsafeCommander let fly: its
link-fed primary, or the fallback after the link went stale.
§Examples
use stable_flight::FailsafeState;
let link_ok = |state: Option<FailsafeState>| state != Some(FailsafeState::Fallback);
assert!(link_ok(Some(FailsafeState::Primary)));
assert!(link_ok(Some(FailsafeState::AwaitingSticks))); // heard, not yet in control
assert!(link_ok(None)); // no failsafe: nothing to report
assert!(!link_ok(Some(FailsafeState::Fallback)));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.
Primary
The primary (link-fed) commander flies.
Fallback
The primary went stale, or hasn’t been heard yet; the fallback flies.
AwaitingSticks
The primary is fresh again, but flies sticks over an armed vehicle: the fallback flies until a stick moves, so a forgotten joystick can’t take over.
Trait Implementations§
Source§impl Clone for FailsafeState
impl Clone for FailsafeState
impl Copy for FailsafeState
Source§impl Debug for FailsafeState
impl Debug for FailsafeState
Source§impl<'de> Deserialize<'de> for FailsafeState
impl<'de> Deserialize<'de> for FailsafeState
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 FailsafeState
Source§impl PartialEq for FailsafeState
impl PartialEq for FailsafeState
Source§impl Serialize for FailsafeState
impl Serialize for FailsafeState
impl StructuralPartialEq for FailsafeState
Auto Trait Implementations§
impl Forget for FailsafeState
impl Freeze for FailsafeState
impl Move for FailsafeState
impl RefUnwindSafe for FailsafeState
impl Send for FailsafeState
impl Sync for FailsafeState
impl Unpin for FailsafeState
impl UnsafeUnpin for FailsafeState
impl UnwindSafe for FailsafeState
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.