pub struct SystemMeta { /* private fields */ }
Expand description
The metadata of a System
.
Implementations§
source§impl SystemMeta
impl SystemMeta
sourcepub fn set_name(&mut self, new_name: impl Into<Cow<'static, str>>)
pub fn set_name(&mut self, new_name: impl Into<Cow<'static, str>>)
Sets the name of this system.
Useful to give closure systems more readable and unique names for debugging and tracing.
sourcepub fn set_non_send(&mut self)
pub fn set_non_send(&mut self)
Sets the system to be not Send
.
This is irreversible.
sourcepub fn has_deferred(&self) -> bool
pub fn has_deferred(&self) -> bool
Returns true if the system has deferred SystemParam
’s
sourcepub fn set_has_deferred(&mut self)
pub fn set_has_deferred(&mut self)
Marks the system as having deferred buffers like Commands
This lets the scheduler insert apply_deferred
systems automatically.
sourcepub fn try_warn_param<P>(&self)where
P: SystemParam,
pub fn try_warn_param<P>(&self)where
P: SystemParam,
Emits a warning about inaccessible system param if policy allows it.
sourcepub fn archetype_component_access(&self) -> &Access<ArchetypeComponentId>
pub fn archetype_component_access(&self) -> &Access<ArchetypeComponentId>
Archetype component access that is used to determine which systems can run in parallel with each other in the multithreaded executor.
We use an ArchetypeComponentId
as it is more precise than just checking ComponentId
:
for example if you have one system with Query<&mut A, With<B>
, and one system with Query<&mut A, Without<B>
,
they conflict if you just look at the ComponentId
;
but no archetype that matches the first query will match the second and vice versa,
which means there’s no risk of conflict.
sourcepub unsafe fn archetype_component_access_mut(
&mut self,
) -> &mut Access<ArchetypeComponentId>
pub unsafe fn archetype_component_access_mut( &mut self, ) -> &mut Access<ArchetypeComponentId>
Returns a mutable reference to the Access
for ArchetypeComponentId
.
This is used to determine which systems can run in parallel with each other
in the multithreaded executor.
We use an ArchetypeComponentId
as it is more precise than just checking ComponentId
:
for example if you have one system with Query<&mut A, With<B>
, and one system with Query<&mut A, Without<B>
,
they conflict if you just look at the ComponentId
;
but no archetype that matches the first query will match the second and vice versa,
which means there’s no risk of conflict.
§Safety
No access can be removed from the returned Access
.
sourcepub fn component_access_set(&self) -> &FilteredAccessSet<ComponentId>
pub fn component_access_set(&self) -> &FilteredAccessSet<ComponentId>
Returns a reference to the FilteredAccessSet
for ComponentId
.
Used to check if systems and/or system params have conflicting access.
sourcepub unsafe fn component_access_set_mut(
&mut self,
) -> &mut FilteredAccessSet<ComponentId>
pub unsafe fn component_access_set_mut( &mut self, ) -> &mut FilteredAccessSet<ComponentId>
Returns a mutable reference to the FilteredAccessSet
for ComponentId
.
Used internally to statically check if systems have conflicting access.
§Safety
No access can be removed from the returned FilteredAccessSet
.
Trait Implementations§
source§impl Clone for SystemMeta
impl Clone for SystemMeta
source§fn clone(&self) -> SystemMeta
fn clone(&self) -> SystemMeta
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for SystemMeta
impl RefUnwindSafe for SystemMeta
impl Send for SystemMeta
impl Sync for SystemMeta
impl Unpin for SystemMeta
impl UnwindSafe for SystemMeta
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.