pub trait IntoCondSystem<I, O, M>: IntoSystem<I, O, M>where
I: SystemInput,{
// Provided methods
fn only_if<B, MarkerB>(
self,
system: B,
) -> SilentCondSystem<Self::System, B::System>
where B: IntoSystem<(), bool, MarkerB> { ... }
fn only_if_with_output<B, MarkerB>(
self,
system: B,
) -> CondSystem<Self::System, B::System>
where B: IntoSystem<(), bool, MarkerB> { ... }
}
Expand description
Extend IntoSystem to allow for some conditional execution. Probably only
appropriate for one-shot systems. Prefer
run_if()
when directly
adding to the scheduler.
Provided Methods§
Sourcefn only_if<B, MarkerB>(
self,
system: B,
) -> SilentCondSystem<Self::System, B::System>
fn only_if<B, MarkerB>( self, system: B, ) -> SilentCondSystem<Self::System, B::System>
Only run self’s system if the given system
parameter returns true. No
output is provided. (This is convenient for running systems with
bevy::prelude::Commands::run_system).
Sourcefn only_if_with_output<B, MarkerB>(
self,
system: B,
) -> CondSystem<Self::System, B::System>
fn only_if_with_output<B, MarkerB>( self, system: B, ) -> CondSystem<Self::System, B::System>
Only run self’s system if the given system
parameter returns true. The
output is an Option<Self::Out>
. None
is returned when the condition
returns false.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.