pub struct EventListeners { /* private fields */ }Expand description
All the currently active listeners
Implementations§
Source§impl EventListeners
impl EventListeners
Sourcepub fn add_listener(&mut self, req: EventListenerRequest) -> EventListenerHandle
pub fn add_listener(&mut self, req: EventListenerRequest) -> EventListenerHandle
Register a subscription for a method, returning a handle to remove it.
Sourcepub fn remove_listener(&mut self, handle: &EventListenerHandle) -> bool
pub fn remove_listener(&mut self, handle: &EventListenerHandle) -> bool
Remove a specific listener immediately. Returns true if something was removed.
Sourcepub fn remove_all_for_method(&mut self, method: &MethodId) -> usize
pub fn remove_all_for_method(&mut self, method: &MethodId) -> usize
Remove all listeners for a given method. Returns how many were removed.
Sourcepub fn start_send<T: Event>(&mut self, event: T)
pub fn start_send<T: Event>(&mut self, event: T)
Queue in an event that should be sent to all listeners.
Trait Implementations§
Source§impl Debug for EventListeners
impl Debug for EventListeners
Source§impl Default for EventListeners
impl Default for EventListeners
Source§fn default() -> EventListeners
fn default() -> EventListeners
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EventListeners
impl !RefUnwindSafe for EventListeners
impl Send for EventListeners
impl !Sync for EventListeners
impl Unpin for EventListeners
impl UnsafeUnpin for EventListeners
impl !UnwindSafe for EventListeners
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