pub struct FrameSend<S: Write> { /* private fields */ }
Expand description
send part of websocket frame
Implementations§
Source§impl<S: Write> FrameSend<S>
impl<S: Write> FrameSend<S>
Sourcepub fn new(stream: S, write_state: FrameWriteState) -> Self
pub fn new(stream: S, write_state: FrameWriteState) -> Self
construct method
Sourcepub fn send(&mut self, code: OpCode, payload: &[u8]) -> Result<(), WsError>
pub fn send(&mut self, code: OpCode, payload: &[u8]) -> Result<(), WsError>
send payload
will auto fragment if auto_fragment_size > 0
Sourcepub fn send_owned_frame(&mut self, frame: OwnedFrame) -> Result<(), WsError>
pub fn send_owned_frame(&mut self, frame: OwnedFrame) -> Result<(), WsError>
send a read frame, this method will not check validation of frame and do not fragment
Auto Trait Implementations§
impl<S> Freeze for FrameSend<S>where
S: Freeze,
impl<S> RefUnwindSafe for FrameSend<S>where
S: RefUnwindSafe,
impl<S> Send for FrameSend<S>where
S: Send,
impl<S> Sync for FrameSend<S>where
S: Sync,
impl<S> Unpin for FrameSend<S>where
S: Unpin,
impl<S> UnwindSafe for FrameSend<S>where
S: 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