pub async fn read_length_delimited<S: AsyncRead + Unpin>(
stream: &mut S,
max_size: usize,
) -> Result<Vec<u8>>
Expand description
A helper function to read a length-delimited message from a stream. Takes into account the maximum message size.
ยงErrors
- If the message is too big
- If we fail to read from the stream