Struct bevy::ecs::removal_detection::RemovedComponentEvents
pub struct RemovedComponentEvents { /* private fields */ }
Expand description
Stores the RemovedComponents
event buffers for all types of component in a given World
.
Implementations§
§impl RemovedComponentEvents
impl RemovedComponentEvents
pub fn new() -> RemovedComponentEvents
pub fn new() -> RemovedComponentEvents
Creates an empty storage buffer for component removal events.
pub fn update(&mut self)
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.
pub fn iter(
&self
) -> impl Iterator<Item = (&ComponentId, &Events<RemovedComponentEntity>)>
pub fn iter( &self ) -> impl Iterator<Item = (&ComponentId, &Events<RemovedComponentEntity>)>
Returns an iterator over components and their entity events.
pub fn get(
&self,
component_id: impl Into<ComponentId>
) -> Option<&Events<RemovedComponentEntity>>
pub fn get( &self, component_id: impl Into<ComponentId> ) -> Option<&Events<RemovedComponentEntity>>
Gets the event storage for a given component.
pub fn send(&mut self, component_id: impl Into<ComponentId>, entity: Entity)
pub fn send(&mut self, component_id: impl Into<ComponentId>, entity: Entity)
Sends a removal event for the specified component.
Trait Implementations§
§impl Debug for RemovedComponentEvents
impl Debug for RemovedComponentEvents
§impl Default for RemovedComponentEvents
impl Default for RemovedComponentEvents
§fn default() -> RemovedComponentEvents
fn default() -> RemovedComponentEvents
Returns the “default value” for a type. Read more
§impl<'a> SystemParam for &'a RemovedComponentEvents
impl<'a> SystemParam for &'a RemovedComponentEvents
§type Item<'w, 's> = &'w RemovedComponentEvents
type Item<'w, 's> = &'w RemovedComponentEvents
The item type returned when constructing this system param.
The value of this associated type should be
Self
, instantiated with new lifetimes. Read more§fn init_state(
_world: &mut World,
_system_meta: &mut SystemMeta
) -> <&'a RemovedComponentEvents as SystemParam>::State
fn init_state( _world: &mut World, _system_meta: &mut SystemMeta ) -> <&'a RemovedComponentEvents as SystemParam>::State
Registers any
World
access used by this SystemParam
and creates a new instance of this param’s State
.§unsafe fn get_param<'w, 's>(
_state: &'s mut <&'a RemovedComponentEvents as SystemParam>::State,
_system_meta: &SystemMeta,
world: UnsafeWorldCell<'w>,
_change_tick: Tick
) -> <&'a RemovedComponentEvents as SystemParam>::Item<'w, 's>
unsafe fn get_param<'w, 's>( _state: &'s mut <&'a RemovedComponentEvents as SystemParam>::State, _system_meta: &SystemMeta, world: UnsafeWorldCell<'w>, _change_tick: Tick ) -> <&'a RemovedComponentEvents as SystemParam>::Item<'w, 's>
Creates a parameter to be passed into a
SystemParamFunction
. Read more§unsafe fn new_archetype(
state: &mut Self::State,
archetype: &Archetype,
system_meta: &mut SystemMeta
)
unsafe fn new_archetype( state: &mut Self::State, archetype: &Archetype, system_meta: &mut SystemMeta )
For the specified
Archetype
, registers the components accessed by this SystemParam
(if applicable).a Read more§fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)
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 apply_deferred
.impl<'a> ReadOnlySystemParam for &'a RemovedComponentEvents
Auto Trait Implementations§
impl Freeze for RemovedComponentEvents
impl RefUnwindSafe for RemovedComponentEvents
impl Send for RemovedComponentEvents
impl Sync for RemovedComponentEvents
impl Unpin for RemovedComponentEvents
impl UnwindSafe for RemovedComponentEvents
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
Return the
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
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
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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
.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates
Self
using data from the given World
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.