pub struct RealtimeManager { /* private fields */ }Expand description
Manages WebSocket connections
Implementations§
Source§impl RealtimeManager
impl RealtimeManager
Sourcepub fn broadcast(&self, event: RealtimeEvent)
pub fn broadcast(&self, event: RealtimeEvent)
Broadcast an event to all matching clients
Sourcepub fn client_count(&self) -> usize
pub fn client_count(&self) -> usize
Get number of connected clients
Sourcepub fn subscribe(&self) -> Receiver<RealtimeEvent>
pub fn subscribe(&self) -> Receiver<RealtimeEvent>
Subscribe to events
Sourcepub fn register_client(&self, id: String, filter: SubscriptionFilter)
pub fn register_client(&self, id: String, filter: SubscriptionFilter)
Register a new client
Sourcepub fn unregister_client(&self, id: &str)
pub fn unregister_client(&self, id: &str)
Unregister a client
Sourcepub fn get_client_filter(&self, id: &str) -> Option<SubscriptionFilter>
pub fn get_client_filter(&self, id: &str) -> Option<SubscriptionFilter>
Get client filter
Trait Implementations§
Source§impl Clone for RealtimeManager
impl Clone for RealtimeManager
Auto Trait Implementations§
impl Freeze for RealtimeManager
impl !RefUnwindSafe for RealtimeManager
impl Send for RealtimeManager
impl Sync for RealtimeManager
impl Unpin for RealtimeManager
impl !UnwindSafe for RealtimeManager
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.