pub struct EventChannel<T> { /* private fields */ }Expand description
A typed event channel for game-specific events.
Games insert this as a global resource on World:
use elevator_core::world::World;
use elevator_core::events::EventChannel;
#[derive(Debug)]
enum MyGameEvent { Foo, Bar }
let mut world = World::new();
world.insert_resource(EventChannel::<MyGameEvent>::new());
// Later:
world.resource_mut::<EventChannel<MyGameEvent>>().unwrap().emit(MyGameEvent::Foo);Implementations§
Source§impl<T> EventChannel<T>
impl<T> EventChannel<T>
Trait Implementations§
Source§impl<T: Debug> Debug for EventChannel<T>
impl<T: Debug> Debug for EventChannel<T>
Auto Trait Implementations§
impl<T> Freeze for EventChannel<T>
impl<T> RefUnwindSafe for EventChannel<T>where
T: RefUnwindSafe,
impl<T> Send for EventChannel<T>where
T: Send,
impl<T> Sync for EventChannel<T>where
T: Sync,
impl<T> Unpin for EventChannel<T>where
T: Unpin,
impl<T> UnsafeUnpin for EventChannel<T>
impl<T> UnwindSafe for EventChannel<T>where
T: 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