Skip to main content

read_message

Function read_message 

Source
pub async fn read_message<M: Message + Default>(
    stream: &mut RecvStream,
    max_bytes: usize,
) -> StreamResult<Option<M>>
Expand description

Reads the next message. Ok(None) when the stream ended cleanly before a message; an error when it ended inside one or the length exceeds max_bytes (checked before allocating).