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

        let max_length = self.config.header_value_max_length() + 1;
        let iter = buffer
            .windows(2)
            .take(max_length)
            .enumerate()
            .filter(|&(_, bytes)| bytes == b"\r\n")
            .map(|(i, _)| i);

        for index in iter {
            match buffer.get(index + 2) {
                Some(&byte) if byte == b' ' || byte == b'\t' => continue,
                Some(_) => return Complete(&buffer[0..index]),
                None => return Incomplete,
            }
        }

        if buffer.len() >= max_length {
            Error(DecodeError::HeaderValueTooLong)
        } else {
            Incomplete
        }
    }
/// Decodes a header value from the buffer.
Decodes a header value from the buffer.
Decodes a header value from the buffer .
fn decode_header_value<'buffer>(
        &mut self,
        buffer: &'buffer [u8],
    ) -> DecodeResult<&'buffer [u8]> {
        use self::GenericDecodeResult::*;
        let max_length = self.config.header_value_max_length() + 1;
        let iter = buffer
            .windows(2)
            .take(max_length)
            .enumerate()
            .filter(|&(_, bytes)| bytes == b"\r\n")
            .map(|(i, _)| i);
        for index in iter {
            match buffer.get(index + 2) {
                Some(&byte) if byte == b' ' || byte == b'\t' => continue,
                Some(_) => return Complete(&buffer[0..index]),
                None => return Incomplete,
            }
        }
        if buffer.len() >= max_length {
            Error(DecodeError::HeaderValueTooLong)
        } else {
            Incomplete
        }
    }
fn decode_header_value < ' buffer > ( & mut self , buffer : & ' buffer [ u8 ] , ) -> DecodeResult < & ' buffer [ u8 ] > { use self :: GenericDecodeResult :: * ; let max_length = self . config . header_value_max_length ( ) + 1 ; let iter = buffer . windows ( 2 ) . take ( max_length ) . enumerate ( ) . filter ( | & ( _ , bytes ) | bytes == b" \r \n " ) . map ( | ( i , _ ) | i ) ; for index in iter { match buffer . get ( index + 2 ) { Some ( & byte ) if byte == b' ' || byte == b'\t' => continue , Some ( _ ) => return Complete ( & buffer [ 0 .. index ] ) , None => return Incomplete , } } if buffer . len ( ) >= max_length { Error ( DecodeError :: HeaderValueTooLong ) } else { Incomplete } }
Decodes a header value from the buffer.
Decodes a header value from the buffer .
&mut self
buffer
&'buffer [u8]
&mut self
buffer
&'buffer [u8]