#[repr(transparent)]pub struct Insert<C>(pub C);
Expand description
A TargetedEvent
which adds component C
on an entity when sent. If the
entity already has the component, then the component is replaced.
Any handler which listens for Insert<C>
will run before the component is
inserted. Insert<C>
has no effect if the target entity does not exist or
the event is consumed before it finishes broadcasting.
Tuple Fields§
§0: C
Trait Implementations§
Source§impl<C> Event for Insert<C>where
C: Component,
impl<C> Event for Insert<C>where
C: Component,
Source§type EventIdx = TargetedEventIdx
type EventIdx = TargetedEventIdx
Either
GlobalEventIdx
or TargetedEventIdx
. This indicates if the
event is global or targeted.Source§impl<C> Ord for Insert<C>where
C: Ord,
impl<C> Ord for Insert<C>where
C: Ord,
Source§impl<C> PartialOrd for Insert<C>where
C: PartialOrd,
impl<C> PartialOrd for Insert<C>where
C: PartialOrd,
impl<C> Copy for Insert<C>where
C: Copy,
impl<C> Eq for Insert<C>where
C: Eq,
impl<C> StructuralPartialEq for Insert<C>
Auto Trait Implementations§
impl<C> Freeze for Insert<C>where
C: Freeze,
impl<C> RefUnwindSafe for Insert<C>where
C: RefUnwindSafe,
impl<C> Send for Insert<C>where
C: Send,
impl<C> Sync for Insert<C>where
C: Sync,
impl<C> Unpin for Insert<C>where
C: Unpin,
impl<C> UnwindSafe for Insert<C>where
C: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.