pub struct WebSocket {}Expand description
Stream-based WebSocket.
Implementations§
Source§impl WebSocket
impl WebSocket
Sourcepub async fn new(
url: &str,
) -> WebsocketResult<(WebSocketSender, WebSocketReceiver)>
pub async fn new( url: &str, ) -> WebsocketResult<(WebSocketSender, WebSocketReceiver)>
Creates a new WebSocket and connects it to the specified url.
Returns ConnectionError if it can’t connect.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebSocket
impl RefUnwindSafe for WebSocket
impl Send for WebSocket
impl Sync for WebSocket
impl Unpin for WebSocket
impl UnwindSafe for WebSocket
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