/// returns immediately if there is nothing to read
returns immediately if there is nothing to read
returns immediately if there is nothing to read
fn try_receive_message<M: serde::de::DeserializeOwned>(&mut self) -> anyhow::Result<Option<M>> {
        use anyhow::Context as _;
        match self.try_receive_packet().context("receive")? {
            Some(packet) => {
                let message = crate::decode_message(&packet).context("decode")?;
                Ok(Some(message))
            }
            None => Ok(None),
        }
    }
fn try_receive_message < M : serde :: de :: DeserializeOwned > ( & mut self ) -> anyhow :: Result < Option < M > > { use anyhow :: Context as _ ; match self . try_receive_packet ( ) . context ( " " ) ? { Some ( packet ) => { let message = crate :: decode_message ( & packet ) . context ( " " ) ? ; Ok ( Some ( message ) ) } None => Ok ( None ) , } }
returns immediately if there is nothing to read
returns immediately if there is nothing to read
&mut self