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]
impl<'h, 'b> Response<'h, 'b>
pub fn new(headers: &'h mut [Header<'b>]) -> Response<'h, 'b>
[src]
pub fn new(headers: &'h mut [Header<'b>]) -> Response<'h, 'b>
Creates a new Response
using a slice of Header
s you have allocated.
pub fn parse(&mut self, buf: &'b [u8]) -> Result<usize>
[src]
pub fn parse(&mut self, buf: &'b [u8]) -> Result<usize>
Try to parse a buffer of bytes into this Response
.
Trait Implementations
impl<'headers, 'buf: 'headers> Debug for Response<'headers, 'buf>
[src]
impl<'headers, 'buf: 'headers> Debug for Response<'headers, 'buf>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'headers, 'buf: 'headers> PartialEq for Response<'headers, 'buf>
[src]
impl<'headers, 'buf: 'headers> PartialEq for Response<'headers, 'buf>