pub struct EventSender { /* private fields */ }Expand description
Cloneable sender handle for emitting events via channel.
Obtained from EventBus::sender() when the bus is created with
new_with_channel().
§Thread Safety
EventSender is Clone, Send, and Sync. Multiple threads can
send events concurrently.
Implementations§
Source§impl EventSender
impl EventSender
Sourcepub fn send<E: Event>(&self, event: E)
pub fn send<E: Event>(&self, event: E)
Send an event (blocking if channel is full).
This will block if the channel is full until space is available.
Sourcepub fn try_send<E: Event>(&self, event: E)
pub fn try_send<E: Event>(&self, event: E)
Try to send an event without blocking.
Returns immediately even if the channel is full.
Sourcepub fn send_scoped<E: Event>(&self, event: E, scope: &EventScope)
pub fn send_scoped<E: Event>(&self, event: E, scope: &EventScope)
Send an event with scope tracking.
The scope is incremented before sending.
Trait Implementations§
Source§impl Clone for EventSender
impl Clone for EventSender
Source§fn clone(&self) -> EventSender
fn clone(&self) -> EventSender
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 moreAuto Trait Implementations§
impl Freeze for EventSender
impl RefUnwindSafe for EventSender
impl Send for EventSender
impl Sync for EventSender
impl Unpin for EventSender
impl UnsafeUnpin for EventSender
impl UnwindSafe for EventSender
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