pub enum Remove<C>where
C: ?Sized,{
// some variants omitted
}
Expand description
A TargetedEvent
which removes component C
from an entity when sent.
The component is dropped and cannot be recovered.
Any handler which listens for Remove<C>
will run before the component is
removed. Remove<C>
has no effect if the target entity does not exist or
the event is consumed before it finishes broadcasting.
This type behaves like a unit struct. Use Remove::<C>
to instantiate the
type.
§Examples
world.send_to(target, Remove::<C>);
Trait Implementations§
Source§impl<C> Event for Remove<C>where
C: Component,
impl<C> Event for Remove<C>where
C: Component,
Source§type EventIdx = TargetedEventIdx
type EventIdx = TargetedEventIdx
Either
GlobalEventIdx
or TargetedEventIdx
. This indicates if the
event is global or targeted.impl<C> Copy for Remove<C>where
C: ?Sized,
Auto Trait Implementations§
impl<C> Freeze for Remove<C>where
C: ?Sized,
impl<C> RefUnwindSafe for Remove<C>where
C: ?Sized,
impl<C> Send for Remove<C>where
C: ?Sized,
impl<C> Sync for Remove<C>where
C: ?Sized,
impl<C> Unpin for Remove<C>where
C: ?Sized,
impl<C> UnwindSafe for Remove<C>where
C: ?Sized,
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
Mutably borrows from an owned value. Read more