pub async fn recv<R: AsyncRead + Unpin>(
stream: &mut R,
) -> Result<BytesMut, PacketError>Available on crate feature
compression only.Expand description
Recv the message in tcp-handler compress protocol.
§Runtime
Due to call block_in_place internally,
this function cannot be called in a current_thread runtime.
§Arguments
stream- The tcp stream orReadHalf.
§Example
use tcp_handler::protocols::compress::recv;
let mut reader = recv(&mut server).await?.reader();
let message = reader.read_string()?;