Struct httparse::Response
[−]
[src]
pub struct Response<'headers, 'buf: 'headers> { pub version: Option<u8>, pub code: Option<u16>, pub reason: Option<&'buf str>, pub headers: &'headers mut [Header<'buf>], }
A parsed Response.
See Request
docs for explanation of optional values.
Fields
version: Option<u8>
The response version, such as HTTP/1.1
.
code: Option<u16>
The response code, such as 200
.
reason: Option<&'buf str>
The response reason-phrase, such as OK
.
headers: &'headers mut [Header<'buf>]
The response headers.
Methods
impl<'h, 'b> Response<'h, 'b>
[src]
fn new(headers: &'h mut [Header<'b>]) -> Response<'h, 'b>
[src]
Creates a new Response
using a slice of Header
s you have allocated.
fn parse(&mut self, buf: &'b [u8]) -> Result<usize>
[src]
Try to parse a buffer of bytes into this Response
.