Skip to main content

ReadOnlySystem

Trait ReadOnlySystem 

Source
pub unsafe trait ReadOnlySystem: System {
    // Provided method
    fn run_readonly(
        &mut self,
        input: <Self::In as SystemInput>::Inner<'_>,
        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§

Source

fn run_readonly( &mut self, input: <Self::In as SystemInput>::Inner<'_>, 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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<A, B> ReadOnlySystem for PipeSystem<A, B>
where A: ReadOnlySystem, B: ReadOnlySystem, <B as System>::In: for<'a> SystemInput<Inner<'a> = <A as System>::Out>,

Source§

impl<Func, A, B> ReadOnlySystem for CombinatorSystem<Func, A, B>
where Func: Combine<A, B> + 'static, A: ReadOnlySystem, B: ReadOnlySystem,

Source§

impl<Func, S> ReadOnlySystem for AdapterSystem<Func, S>
where Func: Adapt<S>, S: ReadOnlySystem,

Source§

impl<Marker, In, Out, F> ReadOnlySystem for FunctionSystem<Marker, In, Out, F>
where Marker: 'static, In: SystemInput + 'static, Out: 'static, F: SystemParamFunction<Marker>, <F as SystemParamFunction<Marker>>::In: FromInput<In>, <F as SystemParamFunction<Marker>>::Out: IntoResult<Out>, <F as SystemParamFunction<Marker>>::Param: ReadOnlySystemParam,

Source§

impl<Marker, In, Out, Func, Builder> ReadOnlySystem for BuilderSystem<Marker, In, Out, Func, Builder>
where Marker: 'static, In: SystemInput + 'static, Out: 'static, Func: SystemParamFunction<Marker>, <Func as SystemParamFunction<Marker>>::In: FromInput<In>, <Func as SystemParamFunction<Marker>>::Out: IntoResult<Out>, Builder: SystemParamBuilder<<Func as SystemParamFunction<Marker>>::Param> + Send + Sync + 'static, FunctionSystem<Marker, In, Out, Func>: ReadOnlySystem,