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
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebSocketClient
impl RefUnwindSafe for WebSocketClient
impl Send for WebSocketClient
impl Sync for WebSocketClient
impl Unpin for WebSocketClient
impl UnwindSafe for WebSocketClient
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