pub struct EventDispatcher { /* private fields */ }Expand description
Event dispatcher for sending events to multiple receivers.
Implementations§
Source§impl EventDispatcher
impl EventDispatcher
Sourcepub fn subscribe(&self) -> EventReceiver
pub fn subscribe(&self) -> EventReceiver
Subscribe to events.
Sourcepub fn send(&self, event: DeviceEvent)
pub fn send(&self, event: DeviceEvent)
Send an event.
Sourcepub fn receiver_count(&self) -> usize
pub fn receiver_count(&self) -> usize
Get the number of active receivers.
Sourcepub fn sender(&self) -> EventSender
pub fn sender(&self) -> EventSender
Get the sender for direct use.
Trait Implementations§
Source§impl Clone for EventDispatcher
impl Clone for EventDispatcher
Source§fn clone(&self) -> EventDispatcher
fn clone(&self) -> EventDispatcher
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EventDispatcher
impl Debug for EventDispatcher
Auto Trait Implementations§
impl Freeze for EventDispatcher
impl !RefUnwindSafe for EventDispatcher
impl Send for EventDispatcher
impl Sync for EventDispatcher
impl Unpin for EventDispatcher
impl !UnwindSafe for EventDispatcher
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