bevy_ecs::system

Struct SystemMeta

source
pub struct SystemMeta { /* private fields */ }
Expand description

The metadata of a System.

Implementations§

source§

impl SystemMeta

source

pub fn name(&self) -> &str

Returns the system’s name

source

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.

source

pub fn is_send(&self) -> bool

Returns true if the system is Send.

source

pub fn set_non_send(&mut self)

Sets the system to be not Send.

This is irreversible.

source

pub fn has_deferred(&self) -> bool

Returns true if the system has deferred SystemParam’s

source

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.

source

pub fn try_warn_param<P>(&self)
where P: SystemParam,

Emits a warning about inaccessible system param if policy allows it.

source

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.

source

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.

source

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.

source

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

source§

fn clone(&self) -> SystemMeta

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> Downcast for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

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.
source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> ConditionalSend for T
where T: Send,