pub struct RealtimeClient { /* private fields */ }Implementations§
Source§impl RealtimeClient
impl RealtimeClient
pub async fn connect(base_url: &str, token: &str) -> ClientResult<Self>
pub async fn connect_with_config( base_url: &str, token: &str, cfg: ClientConfig, ) -> ClientResult<Self>
pub async fn join(&self, channel: &str) -> ClientResult<()>
pub async fn leave(&self, channel: &str) -> ClientResult<()>
pub async fn send(&self, channel: &str, message: Value) -> ClientResult<()>
pub async fn send_event( &self, channel: &str, event: &str, message: Value, ) -> ClientResult<()>
pub fn on_message<F>(&self, channel: &str, handler: F) -> SubscriptionId
pub fn on_messages<F>(&self, handler: F) -> SubscriptionId
pub fn on_channel_event<F>(&self, channel: &str, handler: F) -> SubscriptionId
pub fn on_events<F>(&self, handler: F) -> SubscriptionId
pub fn off(&self, id: SubscriptionId) -> bool
Trait Implementations§
Source§impl Clone for RealtimeClient
impl Clone for RealtimeClient
Source§fn clone(&self) -> RealtimeClient
fn clone(&self) -> RealtimeClient
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 RealtimeClient
impl !RefUnwindSafe for RealtimeClient
impl Send for RealtimeClient
impl Sync for RealtimeClient
impl Unpin for RealtimeClient
impl UnsafeUnpin for RealtimeClient
impl !UnwindSafe for RealtimeClient
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