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

        let max_length = self.config.method_max_length() + 1;
        let mut iter = buffer.iter().take(max_length);

        match iter.position(|&byte| byte == b' ') {
            Some(index) => match Method::try_from(&buffer[0..index]) {
                Ok(method) => {
                    self.builder.method(method);
                    self.state = DecodeState::URI;
                    *buffer = &buffer[index + 1..];
                    Complete(())
                }
                Err(error) => Error(error.into()),
            },
            None if buffer.len() >= max_length => Error(DecodeError::MethodTooLong),
            None => Incomplete,
        }
    }
/// Decodes a method from the buffer.
Decodes a method from the buffer.
Decodes a method from the buffer .
fn decode_method<'buffer>(&mut self, buffer: &mut &'buffer [u8]) -> DecodeResult<()> {
        use self::GenericDecodeResult::*;
        let max_length = self.config.method_max_length() + 1;
        let mut iter = buffer.iter().take(max_length);
        match iter.position(|&byte| byte == b' ') {
            Some(index) => match Method::try_from(&buffer[0..index]) {
                Ok(method) => {
                    self.builder.method(method);
                    self.state = DecodeState::URI;
                    *buffer = &buffer[index + 1..];
                    Complete(())
                }
                Err(error) => Error(error.into()),
            },
            None if buffer.len() >= max_length => Error(DecodeError::MethodTooLong),
            None => Incomplete,
        }
    }
fn decode_method < ' buffer > ( & mut self , buffer : & mut & ' buffer [ u8 ] ) -> DecodeResult < ( ) > { use self :: GenericDecodeResult :: * ; let max_length = self . config . method_max_length ( ) + 1 ; let mut iter = buffer . iter ( ) . take ( max_length ) ; match iter . position ( | & byte | byte == b' ' ) { Some ( index ) => match Method :: try_from ( & buffer [ 0 .. index ] ) { Ok ( method ) => { self . builder . method ( method ) ; self . state = DecodeState :: URI ; * buffer = & buffer [ index + 1 .. ] ; Complete ( ( ) ) } Err ( error ) => Error ( error . into ( ) ) , } , None if buffer . len ( ) >= max_length => Error ( DecodeError :: MethodTooLong ) , None => Incomplete , } }
Decodes a method from the buffer.
Decodes a method from the buffer .
&mut self
buffer
&mut &'buffer [u8]
&mut self
buffer
&mut &'buffer [u8]