pub struct WebSocketClient { /* private fields */ }Expand description
WebSocket client implementation
Implementations§
Source§impl WebSocketClient
impl WebSocketClient
Sourcepub fn connect(addr: SocketAddr) -> Result<Self, Box<dyn Error>>
pub fn connect(addr: SocketAddr) -> Result<Self, Box<dyn Error>>
Create a new WebSocket client and connect to the specified address
Sourcepub fn receive(&mut self) -> Result<Option<Response>, Box<dyn Error>>
pub fn receive(&mut self) -> Result<Option<Response>, Box<dyn Error>>
Receive a response from the WebSocket connection
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if the client is connected