RemovedComponentMessages

Struct RemovedComponentMessages 

Source
pub struct RemovedComponentMessages { /* private fields */ }
Expand description

Stores the RemovedComponents event buffers for all types of component in a given World.

Implementations§

Source§

impl RemovedComponentMessages

Source

pub fn new() -> Self

Creates an empty storage buffer for component removal messages.

Source

pub fn update(&mut self)

For each type of component, swaps the event buffers and clears the oldest event buffer. In general, this should be called once per frame/update.

Source

pub fn iter( &self, ) -> impl Iterator<Item = (&ComponentId, &Messages<RemovedComponentEntity>)>

Returns an iterator over components and their entity messages.

Source

pub fn get( &self, component_id: impl Into<ComponentId>, ) -> Option<&Messages<RemovedComponentEntity>>

Gets the event storage for a given component.

Source

pub fn send(&mut self, component_id: impl Into<ComponentId>, entity: Entity)

👎Deprecated since 0.17.0: Use RemovedComponentMessages:write instead.

Sends a removal message for the specified component.

Source

pub fn write(&mut self, component_id: impl Into<ComponentId>, entity: Entity)

Writes a removal message for the specified component.

Trait Implementations§

Source§

impl Debug for RemovedComponentMessages

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RemovedComponentMessages

Source§

fn default() -> RemovedComponentMessages

Returns the “default value” for a type. Read more
Source§

impl<'a> SystemParam for &'a RemovedComponentMessages

Source§

type State = ()

Used to store data which persists across invocations of a system.
Source§

type Item<'w, 's> = &'w RemovedComponentMessages

The item type returned when constructing this system param. The value of this associated type should be Self, instantiated with new lifetimes. Read more
Source§

fn init_state(_world: &mut World) -> Self::State

Creates a new instance of this param’s State.
Source§

fn init_access( _state: &Self::State, _system_meta: &mut SystemMeta, _component_access_set: &mut FilteredAccessSet, _world: &mut World, )

Registers any World access used by this SystemParam
Source§

unsafe fn get_param<'w, 's>( _state: &'s mut Self::State, _system_meta: &SystemMeta, world: UnsafeWorldCell<'w>, _change_tick: Tick, ) -> Self::Item<'w, 's>

Creates a parameter to be passed into a SystemParamFunction. Read more
Source§

fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)

Applies any deferred mutations stored in this SystemParam’s state. This is used to apply Commands during ApplyDeferred.
Source§

fn queue( state: &mut Self::State, system_meta: &SystemMeta, world: DeferredWorld<'_>, )

Queues any deferred mutations to be applied at the next ApplyDeferred.
Source§

unsafe fn validate_param( state: &mut Self::State, system_meta: &SystemMeta, world: UnsafeWorldCell<'_>, ) -> Result<(), SystemParamValidationError>

Validates that the param can be acquired by the get_param. Read more
Source§

impl<'a> ReadOnlySystemParam for &'a RemovedComponentMessages

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromWorld for T
where T: Default,

Source§

fn from_world(_world: &mut World) -> T

Creates Self using default().

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> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
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> ConditionalSend for T
where T: Send,