Skip to main content

read_message

Function read_message 

Source
pub async fn read_message<R: AsyncRead + Unpin, T: DeserializeOwned>(
    reader: &mut R,
) -> Result<T, ChannelError>
Expand description

Receives one message.

§Errors

Returns ChannelError::Closed at the end of the stream, ChannelError::TooLarge, ChannelError::Invalid for a message that doesn’t parse, or an I/O error.