pub struct RealtimeClient { /* private fields */ }Implementations§
Source§impl RealtimeClient
impl RealtimeClient
pub fn new(config: RealtimeClientConfig) -> Self
Sourcepub async fn connect(&mut self) -> Result<Receiver<Event>, AuraxisError>
pub async fn connect(&mut self) -> Result<Receiver<Event>, AuraxisError>
Send a message to the websocket connection.
This function will be spawned as a task and will run concurrently to the rest of the application. It will continually check for messages on the receiver end of the channel. When a message is received, it will be sent to the websocket connection. If sending the message fails, the error is logged and the connection is closed.
§Arguments
websocket- The websocket connection to send messages to.receiver- The channel receiving messages to send.
§Errors
This function will return an error if the websocket connection cannot be created.
pub fn subscribe(&mut self, subscription: SubscriptionSettings)
pub fn clear_subscribe(&mut self, subscription: SubscriptionSettings)
pub fn clear_all_subscriptions(&mut self)
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