pub struct Connection { /* private fields */ }Implementations§
Source§impl Connection
impl Connection
pub fn new(role: Role, config: WebSocketConfig) -> Self
Sourcepub fn receive(
&mut self,
input: &[u8],
output: &mut Vec<u8>,
) -> Result<Received, Error>
pub fn receive( &mut self, input: &[u8], output: &mut Vec<u8>, ) -> Result<Received, Error>
One decode step. consumed and message are independent, and
consumed == 0 does not by itself mean “stop”: see Received.
pub fn send( &mut self, message: Message, output: &mut Vec<u8>, ) -> Result<(), Error>
Sourcepub fn flush(&mut self, output: &mut Vec<u8>) -> Result<(), Error>
pub fn flush(&mut self, output: &mut Vec<u8>) -> Result<(), Error>
Flush automatic pong/close replies after consuming an incoming message.
pub fn close( &mut self, frame: Option<CloseFrame>, deadline: Instant, output: &mut Vec<u8>, ) -> Result<(), Error>
pub fn next_timeout(&self) -> Option<Instant>
pub fn handle_timeout(&mut self, now: Instant) -> Option<u16>
pub fn eof(&mut self) -> Option<u16>
Auto Trait Implementations§
impl !Freeze for Connection
impl Forget for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnsafeUnpin for Connection
impl UnwindSafe for Connection
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