pub struct Client { /* private fields */ }Expand description
High-level protocol client with post-handshake encryption
Implementations§
Source§impl Client
impl Client
Sourcepub async fn connect(addr: &str) -> Result<Self>
pub async fn connect(addr: &str) -> Result<Self>
Connect and perform secure handshake with timeout using default configuration
Sourcepub async fn connect_with_config(config: ClientConfig) -> Result<Self>
pub async fn connect_with_config(config: ClientConfig) -> Result<Self>
Connect and perform secure handshake with custom configuration
Sourcepub async fn send_keepalive(&mut self) -> Result<()>
pub async fn send_keepalive(&mut self) -> Result<()>
Send a keep-alive ping to the server
Sourcepub async fn recv_with_keepalive(
&mut self,
timeout_duration: Duration,
) -> Result<Message>
pub async fn recv_with_keepalive( &mut self, timeout_duration: Duration, ) -> Result<Message>
Wait for messages with keep-alive handling using custom timeout
Sourcepub async fn send_and_wait(&mut self, msg: Message) -> Result<Message>
pub async fn send_and_wait(&mut self, msg: Message) -> Result<Message>
Send a message and wait for a response with keep-alive handling
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