Struct tungstenite::protocol::frame::FrameSocket
source · pub struct FrameSocket<Stream> { /* private fields */ }
Expand description
A reader and writer for WebSocket frames.
Implementations
sourceimpl<Stream> FrameSocket<Stream>
impl<Stream> FrameSocket<Stream>
sourcepub fn from_partially_read(stream: Stream, part: Vec<u8>) -> Self
pub fn from_partially_read(stream: Stream, part: Vec<u8>) -> Self
Create a new frame socket from partially read data.
sourcepub fn into_inner(self) -> (Stream, Vec<u8>)
pub fn into_inner(self) -> (Stream, Vec<u8>)
Extract a stream from the socket.
sourceimpl<Stream> FrameSocket<Stream>where
Stream: Read,
impl<Stream> FrameSocket<Stream>where
Stream: Read,
sourceimpl<Stream> FrameSocket<Stream>where
Stream: Write,
impl<Stream> FrameSocket<Stream>where
Stream: Write,
sourcepub fn write_frame(&mut self, frame: Frame) -> Result<()>
pub fn write_frame(&mut self, frame: Frame) -> Result<()>
Write a frame to stream.
This function guarantees that the frame is queued regardless of any errors. There is no need to resend the frame. In order to handle WouldBlock or Incomplete, call write_pending() afterwards.
sourcepub fn write_pending(&mut self) -> Result<()>
pub fn write_pending(&mut self) -> Result<()>
Complete pending write, if any.
Trait Implementations
Auto Trait Implementations
impl<Stream> RefUnwindSafe for FrameSocket<Stream>where
Stream: RefUnwindSafe,
impl<Stream> Send for FrameSocket<Stream>where
Stream: Send,
impl<Stream> Sync for FrameSocket<Stream>where
Stream: Sync,
impl<Stream> Unpin for FrameSocket<Stream>where
Stream: Unpin,
impl<Stream> UnwindSafe for FrameSocket<Stream>where
Stream: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more