pub struct RealtimeSession { /* private fields */ }Expand description
Cloneable realtime session that multiplexes concurrent RPCs and pushed events over one WebSocket connection.
Create an event receiver with RealtimeSession::subscribe before issuing
RPCs that may cause the server to push update hints.
Implementations§
Source§impl RealtimeSession
impl RealtimeSession
Sourcepub async fn connect(url: &str, token: &str) -> Result<Self, RealtimeError>
pub async fn connect(url: &str, token: &str) -> Result<Self, RealtimeError>
Connects a multiplexed realtime session using the default SDK identity.
Sourcepub async fn connect_with_identity(
url: &str,
token: &str,
identity: ClientIdentity,
) -> Result<Self, RealtimeError>
pub async fn connect_with_identity( url: &str, token: &str, identity: ClientIdentity, ) -> Result<Self, RealtimeError>
Connects a multiplexed realtime session with an explicit client identity.
Sourcepub fn subscribe(&self) -> RealtimeEventReceiver
pub fn subscribe(&self) -> RealtimeEventReceiver
Subscribes to server-pushed events routed by this session.
Sourcepub async fn call<R>(&self, request: R) -> Result<R::Response, RealtimeError>where
R: RpcRequest,
pub async fn call<R>(&self, request: R) -> Result<R::Response, RealtimeError>where
R: RpcRequest,
Invokes a typed Inline RPC while the same transport continues routing pushed events to subscribers.
Trait Implementations§
Source§impl Clone for RealtimeSession
impl Clone for RealtimeSession
Source§fn clone(&self) -> RealtimeSession
fn clone(&self) -> RealtimeSession
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RealtimeSession
impl RefUnwindSafe for RealtimeSession
impl Send for RealtimeSession
impl Sync for RealtimeSession
impl Unpin for RealtimeSession
impl UnsafeUnpin for RealtimeSession
impl UnwindSafe for RealtimeSession
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