Struct event_stream_types::EventBroadcaster
source · pub struct EventBroadcaster<KEY> { /* private fields */ }
Expand description
broadcasts events to many listeners.
This is generic over the key type.
Implementations§
source§impl<KEY> EventBroadcaster<KEY>
impl<KEY> EventBroadcaster<KEY>
sourcepub fn new_connection(&self, key: KEY) -> (EventChunkSender, EventsBody)
pub fn new_connection(&self, key: KEY) -> (EventChunkSender, EventsBody)
Add a new connection indexed by a key.
This returns an EventsBody.
sourcepub async fn broadcast_frame(&self, frame_string: String)
pub async fn broadcast_frame(&self, frame_string: String)
Transmit bytes as frame
This will drop connections which have errored.
Trait Implementations§
source§impl<KEY: Clone> Clone for EventBroadcaster<KEY>
impl<KEY: Clone> Clone for EventBroadcaster<KEY>
source§fn clone(&self) -> EventBroadcaster<KEY>
fn clone(&self) -> EventBroadcaster<KEY>
Returns a copy 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<KEY: Debug> Debug for EventBroadcaster<KEY>
impl<KEY: Debug> Debug for EventBroadcaster<KEY>
Auto Trait Implementations§
impl<KEY> Freeze for EventBroadcaster<KEY>
impl<KEY> RefUnwindSafe for EventBroadcaster<KEY>
impl<KEY> Send for EventBroadcaster<KEY>
impl<KEY> Sync for EventBroadcaster<KEY>
impl<KEY> Unpin for EventBroadcaster<KEY>
impl<KEY> UnwindSafe for EventBroadcaster<KEY>
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