pub trait StateTransPattern<S: State>:
'static
+ Send
+ Sync
+ Sized {
// Required method
fn matches(&self, old: &S, new: &S) -> bool;
// Provided methods
fn will_trans(
self,
) -> impl 'static + Send + Sync + Fn(FlushRef<'_, '_, S>) -> bool { ... }
fn on_exit<M>(
self,
systems: impl IntoScheduleConfigs<ScheduleSystem, M>,
) -> ScheduleConfigs<ScheduleSystem> { ... }
fn on_trans<M>(
self,
systems: impl IntoScheduleConfigs<ScheduleSystem, M>,
) -> ScheduleConfigs<ScheduleSystem> { ... }
fn on_enter<M>(
self,
systems: impl IntoScheduleConfigs<ScheduleSystem, M>,
) -> ScheduleConfigs<ScheduleSystem> { ... }
}Expand description
A type that can match a subset of transitions in the State type S.
A tuple of two StatePattern types can be used as a transition pattern.
See the following extension traits with additional bounds on Self:
Required Methods§
Provided Methods§
Sourcefn will_trans(
self,
) -> impl 'static + Send + Sync + Fn(FlushRef<'_, '_, S>) -> bool
fn will_trans( self, ) -> impl 'static + Send + Sync + Fn(FlushRef<'_, '_, S>) -> bool
Build a run condition that checks if S will undergo a matching transition if triggered.
Sourcefn on_exit<M>(
self,
systems: impl IntoScheduleConfigs<ScheduleSystem, M>,
) -> ScheduleConfigs<ScheduleSystem>
fn on_exit<M>( self, systems: impl IntoScheduleConfigs<ScheduleSystem, M>, ) -> ScheduleConfigs<ScheduleSystem>
Configure systems to run when S exits as part of a matching transition.
Sourcefn on_trans<M>(
self,
systems: impl IntoScheduleConfigs<ScheduleSystem, M>,
) -> ScheduleConfigs<ScheduleSystem>
fn on_trans<M>( self, systems: impl IntoScheduleConfigs<ScheduleSystem, M>, ) -> ScheduleConfigs<ScheduleSystem>
Configure systems to run when S undergoes a matching transition.
Sourcefn on_enter<M>(
self,
systems: impl IntoScheduleConfigs<ScheduleSystem, M>,
) -> ScheduleConfigs<ScheduleSystem>
fn on_enter<M>( self, systems: impl IntoScheduleConfigs<ScheduleSystem, M>, ) -> ScheduleConfigs<ScheduleSystem>
Configure systems to run when S enters as part of a matching transition.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".