pub unsafe trait ReadOnlySystem: System {
// Provided method
fn run_readonly(
&mut self,
input: SystemIn<'_, Self>,
world: &World,
) -> Result<Self::Out, RunSystemError> { ... }
}Expand description
System types that do not modify the World when run.
This is implemented for any systems whose parameters all implement ReadOnlySystemParam.
Note that systems which perform deferred mutations (such as with Commands)
may implement this trait.
§Safety
This must only be implemented for system types which do not mutate the World
when System::run_unsafe is called.
Provided Methods§
Sourcefn run_readonly(
&mut self,
input: SystemIn<'_, Self>,
world: &World,
) -> Result<Self::Out, RunSystemError>
fn run_readonly( &mut self, input: SystemIn<'_, Self>, world: &World, ) -> Result<Self::Out, RunSystemError>
Runs this system with the given input in the world.
Unlike System::run, this can be called with a shared reference to the world,
since this system is known not to modify the world.
Implementors§
impl<A, B> ReadOnlySystem for PipeSystem<A, B>
SAFETY: Both systems are read-only, so any system created by piping them will only read from the world.
impl<Func, A, B> ReadOnlySystem for CombinatorSystem<Func, A, B>
SAFETY: Both systems are read-only, so any system created by combining them will only read from the world.
impl<Func, S> ReadOnlySystem for AdapterSystem<Func, S>where
Func: Adapt<S>,
S: ReadOnlySystem,
impl<Marker, Out, F> ReadOnlySystem for FunctionSystem<Marker, Out, F>where
Marker: 'static,
Out: 'static,
F: SystemParamFunction<Marker, Out: IntoResult<Out>>,
F::Param: ReadOnlySystemParam,
SAFETY: F’s param is ReadOnlySystemParam, so this system will only read from the world.