pub async fn recv<'a, T: Deserialize<'a>>(&'a mut self) -> Result<T, Error> {
        if self.read_end < 2 {
            self.read_end = 2;
        }
        self.finish_read().await?;

        let message_len = LittleEndian::read_u16(&self.read_buffer[0..2]);
        if message_len > self.max_message_len {
            return Err(Error::PrefixTooLarge);
        }
        self.read_end = message_len as usize + 2;
        self.finish_read().await?;

        let bincode_config = self.bincode_config();
        let res = bincode_config.deserialize(&self.read_buffer[2..self.read_end]);
        self.read_pos = 0;
        self.read_end = 0;
        Ok(res?)
    }
/// Read the next available incoming message.
///
/// This method is cancel safe, it will never partially read a message or drop received
/// messages.
Read the next available incoming message.
This method is cancel safe, it will never partially read a message or drop received
messages.
Read the next available incoming message . This method is cancel safe it will never partially read a message or drop received messages .
pub async fn recv<'a, T: Deserialize<'a>>(&'a mut self) -> Result<T, Error> {
        if self.read_end < 2 {
            self.read_end = 2;
        }
        self.finish_read().await?;
        let message_len = LittleEndian::read_u16(&self.read_buffer[0..2]);
        if message_len > self.max_message_len {
            return Err(Error::PrefixTooLarge);
        }
        self.read_end = message_len as usize + 2;
        self.finish_read().await?;
        let bincode_config = self.bincode_config();
        let res = bincode_config.deserialize(&self.read_buffer[2..self.read_end]);
        self.read_pos = 0;
        self.read_end = 0;
        Ok(res?)
    }
pub async fn recv < ' a , T : Deserialize < ' a > > ( & ' a mut self ) -> Result < T , Error > { if self . read_end < 2 { self . read_end = 2 ; } self . finish_read ( ) . await ? ; let message_len = LittleEndian :: read_u16 ( & self . read_buffer [ 0 .. 2 ] ) ; if message_len > self . max_message_len { return Err ( Error :: PrefixTooLarge ) ; } self . read_end = message_len as usize + 2 ; self . finish_read ( ) . await ? ; let bincode_config = self . bincode_config ( ) ; let res = bincode_config . deserialize ( & self . read_buffer [ 2 .. self . read_end ] ) ; self . read_pos = 0 ; self . read_end = 0 ; Ok ( res ? ) }
Read the next available incoming message.
Read the next available incoming message .
&'a mut self
&'a mut self