pub struct WsConnection {
pub url: Url,
pub state: WsState,
pub ready_state: u8,
/* private fields */
}Fields§
§url: Url§state: WsState§ready_state: u8Implementations§
Source§impl WsConnection
impl WsConnection
pub fn new(url: Url) -> Self
pub fn fd(&self) -> Option<RawFd>
pub fn set_connect_rx(&mut self, rx: Receiver<Result<Connection, String>>)
pub fn try_advance(&mut self) -> Result<Option<WsEvent>, String>
pub fn send_text(&mut self, data: &str)
pub fn send_binary(&mut self, data: &[u8])
pub fn close(&mut self, code: u16, reason: &str)
pub fn wants_read(&self) -> bool
pub fn wants_write(&self) -> bool
Auto Trait Implementations§
impl Freeze for WsConnection
impl !RefUnwindSafe for WsConnection
impl Send for WsConnection
impl !Sync for WsConnection
impl Unpin for WsConnection
impl UnsafeUnpin for WsConnection
impl !UnwindSafe for WsConnection
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