pub struct Client { /* private fields */ }Expand description
A connected client that can be used to send messages to the server.
§Example
let Some(client) = connect(DummyConnector, DummyHandler).await else {
log::info!("Failed to connect");
return;
};
client.text("hello world").await.unwrap();Implementations§
Source§impl Client
impl Client
Sourcepub fn blocking_text_timeout(
&self,
message: impl Into<String>,
timeout: Duration,
) -> Result<(), SendTimeoutError<Message>>
pub fn blocking_text_timeout( &self, message: impl Into<String>, timeout: Duration, ) -> Result<(), SendTimeoutError<Message>>
Sourcepub async fn binary(
&self,
message: impl IntoIterator<Item = u8>,
) -> Result<(), SendError<Message>>
pub async fn binary( &self, message: impl IntoIterator<Item = u8>, ) -> Result<(), SendError<Message>>
Sourcepub fn blocking_binary(
&self,
message: impl IntoIterator<Item = u8>,
) -> Result<(), SendError<Message>>
pub fn blocking_binary( &self, message: impl IntoIterator<Item = u8>, ) -> Result<(), SendError<Message>>
Sourcepub fn blocking_binary_timeout(
&self,
message: impl IntoIterator<Item = u8>,
timeout: Duration,
) -> Result<(), SendTimeoutError<Message>>
pub fn blocking_binary_timeout( &self, message: impl IntoIterator<Item = u8>, timeout: Duration, ) -> Result<(), SendTimeoutError<Message>>
Sourcepub async fn force_reconnect(&self) -> Result<(), SendError<Command>>
pub async fn force_reconnect(&self) -> Result<(), SendError<Command>>
Sourcepub fn blocking_force_reconnect(&self) -> Result<(), SendError<Command>>
pub fn blocking_force_reconnect(&self) -> Result<(), SendError<Command>>
Sourcepub fn blocking_force_reconnect_timeout(
&self,
timeout: Duration,
) -> Result<(), SendTimeoutError<Command>>
pub fn blocking_force_reconnect_timeout( &self, timeout: Duration, ) -> Result<(), SendTimeoutError<Command>>
Sourcepub fn blocking_close(self) -> Result<()>
pub fn blocking_close(self) -> Result<()>
Trait Implementations§
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