Struct ws_tool::codec::BytesCodec
source · pub struct BytesCodec<S: Read + Write> { /* private fields */ }Expand description
recv/send bytes message
Implementations§
source§impl<S: Read + Write> BytesCodec<S>
impl<S: Read + Write> BytesCodec<S>
sourcepub fn new_with(stream: S, config: FrameConfig) -> Self
pub fn new_with(stream: S, config: FrameConfig) -> Self
construct with stream & config
sourcepub fn factory(_req: Request<()>, stream: S) -> Result<Self, WsError>
pub fn factory(_req: Request<()>, stream: S) -> Result<Self, WsError>
used for server side to construct a new server
sourcepub fn check_fn(
key: String,
resp: Response<()>,
stream: S
) -> Result<Self, WsError>
pub fn check_fn( key: String, resp: Response<()>, stream: S ) -> Result<Self, WsError>
used to client side to construct a new client
sourcepub fn stream_mut(&mut self) -> &mut S
pub fn stream_mut(&mut self) -> &mut S
get mutable underlying stream