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