pub struct Transition<S, C> { /* private fields */ }Expand description
A named transition from one state to another.
Implementations§
Source§impl<S, C> Transition<S, C>where
S: State,
impl<S, C> Transition<S, C>where
S: State,
Sourcepub fn new(name: impl Into<String>, to: S) -> Self
pub fn new(name: impl Into<String>, to: S) -> Self
Create a transition that may be applied from any current state.
Sourcepub fn with_guard(
self,
guard: impl Fn(&S, &C) -> AppResult<()> + Send + Sync + 'static,
) -> Self
pub fn with_guard( self, guard: impl Fn(&S, &C) -> AppResult<()> + Send + Sync + 'static, ) -> Self
Add a guard that must allow the transition.
Auto Trait Implementations§
impl<S, C> !RefUnwindSafe for Transition<S, C>
impl<S, C> !UnwindSafe for Transition<S, C>
impl<S, C> Freeze for Transition<S, C>where
S: Freeze,
impl<S, C> Send for Transition<S, C>where
S: Send,
impl<S, C> Sync for Transition<S, C>where
S: Sync,
impl<S, C> Unpin for Transition<S, C>where
S: Unpin,
impl<S, C> UnsafeUnpin for Transition<S, C>where
S: UnsafeUnpin,
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