Struct bevy::ecs::system::FunctionSystem
pub struct FunctionSystem<In, Out, Param, Marker, F>where
Param: SystemParam,{ /* private fields */ }
Expand description
The System
counter part of an ordinary function.
You get this by calling IntoSystem::into_system
on a function that only accepts
SystemParam
s. The output of the system becomes the functions return type, while the input
becomes the functions In
tagged parameter or ()
if no such parameter exists.
FunctionSystem
must be .initialized
before they can be run.
Trait Implementations§
§impl<In, Out, Param, Marker, F> System for FunctionSystem<In, Out, Param, Marker, F>where
In: 'static,
Out: 'static,
Param: 'static + SystemParam,
Marker: 'static,
F: 'static + SystemParamFunction<In, Out, Param, Marker> + Send + Sync,
impl<In, Out, Param, Marker, F> System for FunctionSystem<In, Out, Param, Marker, F>where
In: 'static,
Out: 'static,
Param: 'static + SystemParam,
Marker: 'static,
F: 'static + SystemParamFunction<In, Out, Param, Marker> + Send + Sync,
§fn component_access(&self) -> &Access<ComponentId>
fn component_access(&self) -> &Access<ComponentId>
Returns the system’s component
Access
.§fn archetype_component_access(&self) -> &Access<ArchetypeComponentId>
fn archetype_component_access(&self) -> &Access<ArchetypeComponentId>
Returns the system’s archetype component
Access
.§fn is_exclusive(&self) -> bool
fn is_exclusive(&self) -> bool
Returns true if the system must be run exclusively.
§unsafe fn run_unsafe(
&mut self,
input: <FunctionSystem<In, Out, Param, Marker, F> as System>::In,
world: &World
) -> <FunctionSystem<In, Out, Param, Marker, F> as System>::Out
unsafe fn run_unsafe(
&mut self,
input: <FunctionSystem<In, Out, Param, Marker, F> as System>::In,
world: &World
) -> <FunctionSystem<In, Out, Param, Marker, F> as System>::Out
Runs the system with the given input in the world. Unlike
System::run
, this function
takes a shared reference to World
and may therefore break Rust’s aliasing rules, making
it unsafe to call. Read more§fn get_last_change_tick(&self) -> u32
fn get_last_change_tick(&self) -> u32
Gets the system’s last change tick
§fn set_last_change_tick(&mut self, last_change_tick: u32)
fn set_last_change_tick(&mut self, last_change_tick: u32)
Sets the system’s last change tick Read more
fn apply_buffers(&mut self, world: &mut World)
§fn initialize(&mut self, world: &mut World)
fn initialize(&mut self, world: &mut World)
Initialize the system.
§fn update_archetype_component_access(&mut self, world: &World)
fn update_archetype_component_access(&mut self, world: &World)
Update the system’s archetype component
Access
.fn check_change_tick(&mut self, change_tick: u32)
§fn default_labels(&self) -> Vec<SystemLabelId, Global> ⓘ
fn default_labels(&self) -> Vec<SystemLabelId, Global> ⓘ
The default labels for the system
Auto Trait Implementations§
impl<In, Out, Param, Marker, F> RefUnwindSafe for FunctionSystem<In, Out, Param, Marker, F>where
F: RefUnwindSafe,
<Param as SystemParam>::Fetch: RefUnwindSafe,
impl<In, Out, Param, Marker, F> Send for FunctionSystem<In, Out, Param, Marker, F>where
F: Send,
impl<In, Out, Param, Marker, F> Sync for FunctionSystem<In, Out, Param, Marker, F>where
F: Sync,
impl<In, Out, Param, Marker, F> Unpin for FunctionSystem<In, Out, Param, Marker, F>where
F: Unpin,
<Param as SystemParam>::Fetch: Unpin,
impl<In, Out, Param, Marker, F> UnwindSafe for FunctionSystem<In, Out, Param, Marker, F>where
F: UnwindSafe,
<Param as SystemParam>::Fetch: UnwindSafe,
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
Return the
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist. Read more§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read moresource§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<SystemA, ParamA, Payload, SystemB, ParamB, Out> IntoPipeSystem<ParamA, Payload, SystemB, ParamB, Out> for SystemAwhere
SystemA: IntoSystem<(), Payload, ParamA>,
SystemB: IntoSystem<Payload, Out, ParamB>,
impl<SystemA, ParamA, Payload, SystemB, ParamB, Out> IntoPipeSystem<ParamA, Payload, SystemB, ParamB, Out> for SystemAwhere
SystemA: IntoSystem<(), Payload, ParamA>,
SystemB: IntoSystem<Payload, Out, ParamB>,
§fn pipe(
self,
system: SystemB
) -> PipeSystem<<SystemA as IntoSystem<(), Payload, ParamA>>::System, <SystemB as IntoSystem<Payload, Out, ParamB>>::System>
fn pipe(
self,
system: SystemB
) -> PipeSystem<<SystemA as IntoSystem<(), Payload, ParamA>>::System, <SystemB as IntoSystem<Payload, Out, ParamB>>::System>
Pass the output of this system
A
into a second system B
, creating a new compound system.§impl<S, Param> IntoRunCriteria<(Box<dyn System<In = (), Out = ShouldRun> + 'static, Global>, Param)> for Swhere
S: IntoSystem<(), ShouldRun, Param>,
impl<S, Param> IntoRunCriteria<(Box<dyn System<In = (), Out = ShouldRun> + 'static, Global>, Param)> for Swhere
S: IntoSystem<(), ShouldRun, Param>,
fn into(self) -> RunCriteriaDescriptorOrLabel
§impl<In, Out, Sys> IntoSystem<In, Out, AlreadyWasSystem> for Syswhere
Sys: System<In = In, Out = Out>,
impl<In, Out, Sys> IntoSystem<In, Out, AlreadyWasSystem> for Syswhere
Sys: System<In = In, Out = Out>,
type System = Sys
§fn into_system(this: Sys) -> Sys
fn into_system(this: Sys) -> Sys
Turns this value into its corresponding
System
.§impl<S, Params> IntoSystemDescriptor<Params> for Swhere
S: IntoSystem<(), (), Params>,
impl<S, Params> IntoSystemDescriptor<Params> for Swhere
S: IntoSystem<(), (), Params>,
§fn with_run_criteria<Marker>(
self,
run_criteria: impl IntoRunCriteria<Marker>
) -> SystemDescriptor
fn with_run_criteria<Marker>(
self,
run_criteria: impl IntoRunCriteria<Marker>
) -> SystemDescriptor
Assigns a run criteria to the system. Can be a new descriptor or a label of a
run criteria defined elsewhere. Read more
§fn label(self, label: impl SystemLabel) -> SystemDescriptor
fn label(self, label: impl SystemLabel) -> SystemDescriptor
Assigns a label to the system; there can be more than one, and it doesn’t have to be unique.
§fn before<Marker>(self, label: impl AsSystemLabel<Marker>) -> SystemDescriptor
fn before<Marker>(self, label: impl AsSystemLabel<Marker>) -> SystemDescriptor
Specifies that the system should run before systems with the given label.
§fn after<Marker>(self, label: impl AsSystemLabel<Marker>) -> SystemDescriptor
fn after<Marker>(self, label: impl AsSystemLabel<Marker>) -> SystemDescriptor
Specifies that the system should run after systems with the given label.
§fn ambiguous_with<Marker>(
self,
label: impl AsSystemLabel<Marker>
) -> SystemDescriptor
fn ambiguous_with<Marker>(
self,
label: impl AsSystemLabel<Marker>
) -> SystemDescriptor
Marks this system as ambiguous with any system with the specified label.
This means that execution order between these systems does not matter,
which allows some warnings to be silenced. Read more
§fn ignore_all_ambiguities(self) -> SystemDescriptor
fn ignore_all_ambiguities(self) -> SystemDescriptor
Specifies that this system should opt out of
execution order ambiguity detection. Read more
§fn at_start(self) -> SystemDescriptor
fn at_start(self) -> SystemDescriptor
Specifies that the system should run with other exclusive systems at the start of stage.
§fn before_commands(self) -> SystemDescriptor
fn before_commands(self) -> SystemDescriptor
Specifies that the system should run with other exclusive systems after the parallel
systems and before command buffer application. Read more
§fn at_end(self) -> SystemDescriptor
fn at_end(self) -> SystemDescriptor
Specifies that the system should run with other exclusive systems at the end of stage.
fn into_descriptor(self) -> SystemDescriptor
§impl<S, Param> RunCriteriaDescriptorCoercion<Param> for Swhere
S: IntoSystem<(), ShouldRun, Param>,
impl<S, Param> RunCriteriaDescriptorCoercion<Param> for Swhere
S: IntoSystem<(), ShouldRun, Param>,
§fn label(self, label: impl RunCriteriaLabel) -> RunCriteriaDescriptor
fn label(self, label: impl RunCriteriaLabel) -> RunCriteriaDescriptor
Assigns a label to the criteria. Must be unique.
§fn label_discard_if_duplicate(
self,
label: impl RunCriteriaLabel
) -> RunCriteriaDescriptor
fn label_discard_if_duplicate(
self,
label: impl RunCriteriaLabel
) -> RunCriteriaDescriptor
Assigns a label to the criteria. If the given label is already in use,
this criteria will be discarded before initialization. Read more
§fn before(self, label: impl RunCriteriaLabel) -> RunCriteriaDescriptor
fn before(self, label: impl RunCriteriaLabel) -> RunCriteriaDescriptor
Specifies that this criteria must be evaluated before a criteria with the given label.
§fn after(self, label: impl RunCriteriaLabel) -> RunCriteriaDescriptor
fn after(self, label: impl RunCriteriaLabel) -> RunCriteriaDescriptor
Specifies that this criteria must be evaluated after a criteria with the given label.