pub struct RealtimeClientBuilder { /* private fields */ }Expand description
Builder for RealtimeClient.
Implementations§
Source§impl RealtimeClientBuilder
impl RealtimeClientBuilder
Sourcepub fn new(url: impl Into<String>, token: impl Into<String>) -> Self
pub fn new(url: impl Into<String>, token: impl Into<String>) -> Self
Creates a realtime client builder with the default SDK identity.
Sourcepub fn identity(self, identity: ClientIdentity) -> Self
pub fn identity(self, identity: ClientIdentity) -> Self
Sets the client identity used in realtime headers and connection init.
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Sets the timeout for opening the WebSocket and receiving ConnectionOpen.
Sourcepub fn without_connect_timeout(self) -> Self
pub fn without_connect_timeout(self) -> Self
Disables the connect timeout.
Sourcepub fn rpc_timeout(self, timeout: Duration) -> Self
pub fn rpc_timeout(self, timeout: Duration) -> Self
Sets the timeout for each RPC invocation.
Sourcepub fn without_rpc_timeout(self) -> Self
pub fn without_rpc_timeout(self) -> Self
Disables the per-RPC timeout.
Sourcepub fn max_in_flight_rpcs(self, maximum: usize) -> Self
pub fn max_in_flight_rpcs(self, maximum: usize) -> Self
Sets the maximum number of RPCs awaiting responses on one session.
Sourcepub fn heartbeat(self, interval: Duration, timeout: Duration) -> Self
pub fn heartbeat(self, interval: Duration, timeout: Duration) -> Self
Configures protocol heartbeat interval and pong deadline.
Sourcepub fn without_heartbeat(self) -> Self
pub fn without_heartbeat(self) -> Self
Disables multiplexed-session protocol heartbeat pings.
Sourcepub async fn connect(self) -> Result<RealtimeClient, RealtimeError>
pub async fn connect(self) -> Result<RealtimeClient, RealtimeError>
Opens the WebSocket connection and waits for ConnectionOpen.
Sourcepub async fn connect_session(self) -> Result<RealtimeSession, RealtimeError>
pub async fn connect_session(self) -> Result<RealtimeSession, RealtimeError>
Opens one WebSocket and starts a multiplexed session for concurrent RPC calls and pushed events.
Trait Implementations§
Source§impl Clone for RealtimeClientBuilder
impl Clone for RealtimeClientBuilder
Source§fn clone(&self) -> RealtimeClientBuilder
fn clone(&self) -> RealtimeClientBuilder
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 RealtimeClientBuilder
impl RefUnwindSafe for RealtimeClientBuilder
impl Send for RealtimeClientBuilder
impl Sync for RealtimeClientBuilder
impl Unpin for RealtimeClientBuilder
impl UnsafeUnpin for RealtimeClientBuilder
impl UnwindSafe for RealtimeClientBuilder
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