pub struct Connection<Handler> { /* private fields */ }
Implementations§
Source§impl<H> Connection<H>where
H: Handler,
impl<H> Connection<H>where
H: Handler,
pub fn new(sock: TcpStream, handler: H, settings: Settings) -> Connection<H>
pub fn as_server(&mut self) -> Result<()>
pub fn as_client(&mut self, url: &Url, addrs: Vec<SocketAddr>) -> Result<()>
pub fn socket(&self) -> &TcpStream
pub fn reset(&mut self) -> Result<()>
pub fn set_read_time(&mut self, read_time: u64)
pub fn get_read_time(&self) -> u64
pub fn is_over(&self) -> bool
pub fn is_closing(&self) -> bool
pub fn is_client(&self) -> bool
pub fn is_server(&self) -> bool
pub fn shutdown(&mut self)
pub fn error(&mut self, err: Error)
pub fn disconnect(&mut self)
pub fn consume(self) -> H
pub fn new_data_received(&mut self, data: &[u8])
pub fn read(&mut self) -> Result<()>
pub fn write(&mut self) -> Result<()>
pub fn send_message(&mut self, msg: Message) -> Result<()>
pub fn send_ping(&mut self, data: Vec<u8>) -> Result<()>
pub fn send_pong(&mut self, data: Vec<u8>) -> Result<()>
pub fn send_close<R>(&mut self, code: CloseCode, reason: R) -> Result<()>
Auto Trait Implementations§
impl<Handler> Freeze for Connection<Handler>where
Handler: Freeze,
impl<Handler> RefUnwindSafe for Connection<Handler>where
Handler: RefUnwindSafe,
impl<Handler> Send for Connection<Handler>where
Handler: Send,
impl<Handler> Sync for Connection<Handler>where
Handler: Sync,
impl<Handler> Unpin for Connection<Handler>where
Handler: Unpin,
impl<Handler> UnwindSafe for Connection<Handler>where
Handler: UnwindSafe,
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