/// Parse a buffer of bytes as headers.
///
/// The return value, if complete and successful, includes the index of the
/// buffer that parsing stopped at, and a sliced reference to the parsed
/// headers. The length of the slice will be equal to the number of properly
/// parsed headers.
///
/// # Example
///
/// ```
/// let buf = b"Host: foo.bar\nAccept: */*\n\nblah blah";
/// let mut headers = [httparse::EMPTY_HEADER; 4];
/// assert_eq!(httparse::parse_headers(buf, &mut headers),
///            Ok(httparse::Status::Complete((27, &[
///                httparse::Header { name: "Host", value: b"foo.bar" },
///                httparse::Header { name: "Accept", value: b"*/*" }
///            ][..]))));
/// ```
Parse a buffer of bytes as headers.
The return value, if complete and successful, includes the index of the
buffer that parsing stopped at, and a sliced reference to the parsed
headers. The length of the slice will be equal to the number of properly
parsed headers.
Parse a buffer of bytes as headers . The return value if complete and successful includes the index of the buffer that parsing stopped at and a sliced reference to the parsed headers . The length of the slice will be equal to the number of properly parsed headers .
pub fn parse_headers<'b: 'h, 'h>(
    src: &'b [u8],
    mut dst: &'h mut [Header<'b>],
) -> Result<(usize, &'h [Header<'b>])> {
    let mut iter = Bytes::new(src);
    let pos = complete!(parse_headers_iter(&mut dst, &mut iter, &ParserConfig::default()));
    Ok(Status::Complete((pos, dst)))
}
pub fn parse_headers < ' b : ' h , ' h > ( src : & ' b [ u8 ] , mut dst : & ' h mut [ Header < ' b > ] , ) -> Result < ( usize , & ' h [ Header < ' b > ] ) > { let mut iter = Bytes :: new ( src ) ; let pos = complete ! ( parse_headers_iter ( mut dst mut iter ParserConfig default ( ) ) ) ; Ok ( Status :: Complete ( ( pos , dst ) ) ) }
Parse a buffer of bytes as headers.
Parse a buffer of bytes as headers .
src
&'b [u8]
dst
&'h mut [Header<'b>]
example
```
let buf = b"Host: foo.bar\nAccept: *\n\nblah blah";
let mut headers = [httparse::EMPTY_HEADER; 4];
assert_eq!,
Ok(httparse::Status::Complete((27, &[
httparse::Header { name: "Host", value: b"foo.bar" },
httparse::Header { name: "Accept", value: b"*" }
][..]))));
```
` ` ` let buf = b " Host : foo . bar \ nAccept : * \ n \ nblah blah " ; let mut headers = [ httparse :: EMPTY_HEADER ; 4 ] ; assert_eq! Ok ( httparse :: Status :: Complete (( 27 & [ httparse :: Header { name : " Host " value : b " foo . bar " } httparse :: Header { name : " Accept " value : b " * " } ] [ .. ] )))) ; ` ` `