pub struct Client { /* private fields */ }Expand description
A connected relay client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Start building a client.
Sourcepub async fn join(
&mut self,
room_id: &str,
data: Option<&[u8]>,
) -> Result<(), SyncError>
pub async fn join( &mut self, room_id: &str, data: Option<&[u8]>, ) -> Result<(), SyncError>
Join a room. If room does not exist, returns SyncError::RoomNotFound
Sourcepub async fn echo_test(&mut self, data: &[u8]) -> Result<(), SyncError>
pub async fn echo_test(&mut self, data: &[u8]) -> Result<(), SyncError>
An Echo check that can be performed at any time to verify the connection is alive and measure latency.
Prefers raw bytes to avoid serialization overhead and perform after Client::join, limit at max_payload
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
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