fn decode_reason_phrase<'buffer>(&mut self, buffer: &mut &'buffer [u8]) -> DecodeResult<()> {
        use self::GenericDecodeResult::*;

        let max_length = self.config.reason_phrase_max_length() + 2;

        match buffer
            .windows(2)
            .take(max_length)
            .position(|bytes| bytes == b"\r\n")
        {
            Some(index) => match ReasonPhrase::try_from(&buffer[0..index]) {
                Ok(reason_phrase) => {
                    self.builder.reason_phrase(Some(reason_phrase));
                    self.state = DecodeState::Header;
                    *buffer = &buffer[index + 2..];
                    Complete(())
                }
                Err(error) => Error(error.into()),
            },
            None if buffer.len() >= max_length => Error(DecodeError::ReasonPhraseTooLong),
            None => Incomplete,
        }
    }
/// Decodes a reason phrase from the buffer.
Decodes a reason phrase from the buffer.
Decodes a reason phrase from the buffer .
fn decode_reason_phrase<'buffer>(&mut self, buffer: &mut &'buffer [u8]) -> DecodeResult<()> {
        use self::GenericDecodeResult::*;
        let max_length = self.config.reason_phrase_max_length() + 2;
        match buffer
            .windows(2)
            .take(max_length)
            .position(|bytes| bytes == b"\r\n")
        {
            Some(index) => match ReasonPhrase::try_from(&buffer[0..index]) {
                Ok(reason_phrase) => {
                    self.builder.reason_phrase(Some(reason_phrase));
                    self.state = DecodeState::Header;
                    *buffer = &buffer[index + 2..];
                    Complete(())
                }
                Err(error) => Error(error.into()),
            },
            None if buffer.len() >= max_length => Error(DecodeError::ReasonPhraseTooLong),
            None => Incomplete,
        }
    }
fn decode_reason_phrase < ' buffer > ( & mut self , buffer : & mut & ' buffer [ u8 ] ) -> DecodeResult < ( ) > { use self :: GenericDecodeResult :: * ; let max_length = self . config . reason_phrase_max_length ( ) + 2 ; match buffer . windows ( 2 ) . take ( max_length ) . position ( | bytes | bytes == b" \r \n " ) { Some ( index ) => match ReasonPhrase :: try_from ( & buffer [ 0 .. index ] ) { Ok ( reason_phrase ) => { self . builder . reason_phrase ( Some ( reason_phrase ) ) ; self . state = DecodeState :: Header ; * buffer = & buffer [ index + 2 .. ] ; Complete ( ( ) ) } Err ( error ) => Error ( error . into ( ) ) , } , None if buffer . len ( ) >= max_length => Error ( DecodeError :: ReasonPhraseTooLong ) , None => Incomplete , } }
Decodes a reason phrase from the buffer.
Decodes a reason phrase from the buffer .
&mut self
buffer
&mut &'buffer [u8]
&mut self
buffer
&mut &'buffer [u8]