Struct httparse::Response [] [src]

pub struct Response<'headers, 'buf> {
    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

The response version, such as HTTP/1.1.

code

The response code, such as 200.

reason

The response reason-phrase, such as OK.

headers

THe response headers.

Methods

impl<'h, 'b> Response<'h, 'b>

fn new(headers: &'h mut [Header<'b>]) -> Response<'h, 'b>

Creates a new Response using a slice of Headers you have allocated.

fn parse(&mut self, buf: &'b [u8]) -> Result<usize>

Try to parse a buffer of bytes into this Response.