pub struct ChannelEventHandler { /* private fields */ }Expand description
Channel-based event handler for async consumers
This handler uses a broadcast channel to distribute events, allowing multiple receivers to subscribe.
Implementations§
Source§impl ChannelEventHandler
impl ChannelEventHandler
Sourcepub fn new(capacity: usize) -> (Self, Receiver<EngineEvent>)
pub fn new(capacity: usize) -> (Self, Receiver<EngineEvent>)
Sourcepub fn subscribe(&self) -> Receiver<EngineEvent>
pub fn subscribe(&self) -> Receiver<EngineEvent>
Subscribe to receive events
Multiple subscribers can receive the same events.
Trait Implementations§
Source§impl EventHandler for ChannelEventHandler
impl EventHandler for ChannelEventHandler
Source§fn on_event(&self, event: EngineEvent)
fn on_event(&self, event: EngineEvent)
Called when an engine event occurs
Auto Trait Implementations§
impl Freeze for ChannelEventHandler
impl !RefUnwindSafe for ChannelEventHandler
impl Send for ChannelEventHandler
impl Sync for ChannelEventHandler
impl Unpin for ChannelEventHandler
impl !UnwindSafe for ChannelEventHandler
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