Struct ws_tool::codec::DeflateSend
source · pub struct DeflateSend<S: Write> { /* private fields */ }
Expand description
send part of deflate message
Implementations§
source§impl<S: Write> DeflateSend<S>
impl<S: Write> DeflateSend<S>
sourcepub fn new(stream: S, write_state: DeflateWriteState) -> Self
pub fn new(stream: S, write_state: DeflateWriteState) -> Self
construct method
sourcepub fn stream_mut(&mut self) -> &mut S
pub fn stream_mut(&mut self) -> &mut S
get mutable underlying stream
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
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 before compression if auto_fragment_size > 0
sourcepub fn binary(&mut self, data: &[u8]) -> Result<(), WsError>
pub fn binary(&mut self, data: &[u8]) -> Result<(), WsError>
helper function to send binary message
sourcepub fn ping(&mut self, data: &[u8]) -> Result<(), WsError>
pub fn ping(&mut self, data: &[u8]) -> Result<(), WsError>
helper function to send ping message
sourcepub fn pong(&mut self, data: &[u8]) -> Result<(), WsError>
pub fn pong(&mut self, data: &[u8]) -> Result<(), WsError>
helper function to send ping message
Auto Trait Implementations§
impl<S> RefUnwindSafe for DeflateSend<S>where
S: RefUnwindSafe,
impl<S> Send for DeflateSend<S>where
S: Send,
impl<S> Sync for DeflateSend<S>where
S: Sync,
impl<S> Unpin for DeflateSend<S>where
S: Unpin,
impl<S> UnwindSafe for DeflateSend<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