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§
Trait Implementations§
Source§impl From<bool> for TransitGuard
Implements from trait for use of use.
This allows to transit by returning true. Which simplify the code since it allows to return the
TransitGuard from a simple comparison.
impl From<bool> for TransitGuard
Implements from
fn guard(&self) -> TransitGuard {
let foo = 0;
(foo == 0).into() // Returns TransitGuard::Transit
}
Source§impl PartialEq for TransitGuard
impl PartialEq for TransitGuard
impl StructuralPartialEq for TransitGuard
Auto Trait Implementations§
impl Freeze for TransitGuard
impl RefUnwindSafe for TransitGuard
impl Send for TransitGuard
impl Sync for TransitGuard
impl Unpin for TransitGuard
impl UnwindSafe for TransitGuard
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