pub fn read_message(&mut self) -> Result<IrcMessage<'_>, DecodeError> {
        self.buf.clear();
        let n = self
            .reader
            .read_until(b'\n', &mut self.buf)
            .map_err(DecodeError::Io)?;
        if n == 0 {
            return Err(DecodeError::Eof);
        }

        let str = std::str::from_utf8(&self.buf[..n]).map_err(DecodeError::InvalidUtf8)?;

        // this should only ever parse 1 message
        crate::irc::parse_one(str)
            .map_err(DecodeError::ParseError)
            .map(|(_, msg)| msg)
    }
/// Read the next message.
///
/// This returns a borrowed [IrcMessage] which is valid until the next Decoder call is made.
///
/// If you just want an owned one, use the [Decoder] as an iterator. e.g. dec.next().
Read the next message.
This returns a borrowed [IrcMessage] which is valid until the next Decoder call is made.

If you just want an owned one, use the [Decoder] as an iterator.
Read the next message . This returns a borrowed [ IrcMessage ] which is valid until the next Decoder call is made . If you just want an owned one use the [ Decoder ] as an iterator .
pub fn read_message(&mut self) -> Result<IrcMessage<'_>, DecodeError> {
        self.buf.clear();
        let n = self
            .reader
            .read_until(b'\n', &mut self.buf)
            .map_err(DecodeError::Io)?;
        if n == 0 {
            return Err(DecodeError::Eof);
        }
        let str = std::str::from_utf8(&self.buf[..n]).map_err(DecodeError::InvalidUtf8)?;
        // this should only ever parse 1 message
        crate::irc::parse_one(str)
            .map_err(DecodeError::ParseError)
            .map(|(_, msg)| msg)
    }
pub fn read_message ( & mut self ) -> Result < IrcMessage < ' _ > , DecodeError > { self . buf . clear ( ) ; let n = self . reader . read_until ( b'\n' , & mut self . buf ) . map_err ( DecodeError :: Io ) ? ; if n == 0 { return Err ( DecodeError :: Eof ) ; } let str = std :: str :: from_utf8 ( & self . buf [ .. n ] ) . map_err ( DecodeError :: InvalidUtf8 ) ? ; // this should only ever parse 1 message crate :: irc :: parse_one ( str ) . map_err ( DecodeError :: ParseError ) . map ( | ( _ , msg ) | msg ) }
Read the next message.
Read the next message .
&mut self
&mut self