Function recv
Source pub async fn recv<R: AsyncRead + Unpin>(
stream: &mut R,
) -> Result<BytesMut, PacketError>
Expand description
Recv the message in tcp-handler raw protocol.
§Arguments
stream
- The tcp stream or ReadHalf
.
§Example
use tcp_handler::protocols::raw::recv;
let mut reader = recv(&mut server).await?.reader();
let message = reader.read_string()?;