Enum sfsm::TransitGuard
source · [−]pub enum TransitGuard {
Remain,
Transit,
}
Expand description
Enum used to indicate to the guard function if the transition should transit to the next state or remain in the current one.
fn guard(&self) -> TransitGuard {
let foo = 0;
if foo == 0 {
TransitGuard::Remain
} else {
TransitGuard::Transit
}
}
Variants
Remain
Remains in the current state
Transit
Transits into the next state
Trait Implementations
sourceimpl From<bool> for TransitGuard
impl From<bool> for TransitGuard
Implements from
fn guard(&self) -> TransitGuard {
let foo = 0;
(foo == 0).into() // Returns TransitGuard::Transit
}
sourcefn from(transit: bool) -> TransitGuard
fn from(transit: bool) -> TransitGuard
Converts to this type from the input type.
sourceimpl PartialEq<TransitGuard> for TransitGuard
impl PartialEq<TransitGuard> for TransitGuard
impl StructuralPartialEq for TransitGuard
Auto Trait Implementations
impl RefUnwindSafe for TransitGuard
impl Send for TransitGuard
impl Sync for TransitGuard
impl Unpin for TransitGuard
impl UnwindSafe for TransitGuard
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more