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

        if buffer.starts_with(b"\r\n") {
            return Complete(None);
        }

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

        match iter.position(|&byte| byte == b':') {
            Some(index) => Complete(Some(&buffer[0..index])),
            None if buffer.len() >= max_length => Error(DecodeError::HeaderNameTooLong),
            None => Incomplete,
        }
    }
/// Decodes a header name from the buffer.
Decodes a header name from the buffer.
Decodes a header name from the buffer .
fn decode_header_name<'buffer>(
        &mut self,
        buffer: &'buffer [u8],
    ) -> DecodeResult<Option<&'buffer [u8]>> {
        use self::GenericDecodeResult::*;
        if buffer.starts_with(b"\r\n") {
            return Complete(None);
        }
        let max_length = self.config.header_name_max_length() + 1;
        let mut iter = buffer.iter().take(max_length);
        match iter.position(|&byte| byte == b':') {
            Some(index) => Complete(Some(&buffer[0..index])),
            None if buffer.len() >= max_length => Error(DecodeError::HeaderNameTooLong),
            None => Incomplete,
        }
    }
fn decode_header_name < ' buffer > ( & mut self , buffer : & ' buffer [ u8 ] , ) -> DecodeResult < Option < & ' buffer [ u8 ] > > { use self :: GenericDecodeResult :: * ; if buffer . starts_with ( b" \r \n " ) { return Complete ( None ) ; } let max_length = self . config . header_name_max_length ( ) + 1 ; let mut iter = buffer . iter ( ) . take ( max_length ) ; match iter . position ( | & byte | byte == b':' ) { Some ( index ) => Complete ( Some ( & buffer [ 0 .. index ] ) ) , None if buffer . len ( ) >= max_length => Error ( DecodeError :: HeaderNameTooLong ) , None => Incomplete , } }
Decodes a header name from the buffer.
Decodes a header name from the buffer .
&mut self
buffer
&'buffer [u8]
&mut self
buffer
&'buffer [u8]