pub struct EventWriter<'w, T: Send + 'static> { /* private fields */ }Expand description
Exclusive write access to the Events<T> resource.
Use this in a system to send events that other systems can read on the
next schedule tick via EventReader<T>.
ⓘ
fn fire_cannon(mut writer: EventWriter<'_, CannonFired>) {
writer.send(CannonFired { power: 9000 });
}Implementations§
Trait Implementations§
Source§impl<T: Send + 'static> SystemParam for EventWriter<'_, T>
impl<T: Send + 'static> SystemParam for EventWriter<'_, T>
Auto Trait Implementations§
impl<'w, T> !UnwindSafe for EventWriter<'w, T>
impl<'w, T> Freeze for EventWriter<'w, T>
impl<'w, T> RefUnwindSafe for EventWriter<'w, T>where
&'w mut Events<T>: RefUnwindSafe,
impl<'w, T> Send for EventWriter<'w, T>
impl<'w, T> Sync for EventWriter<'w, T>
impl<'w, T> Unpin for EventWriter<'w, T>
impl<'w, T> UnsafeUnpin for EventWriter<'w, T>where
&'w mut Events<T>: UnsafeUnpin,
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