Struct hyper::server::request::Request [-] [+] [src]

pub struct Request<'a> {
    pub remote_addr: SocketAddr,
    pub method: Method,
    pub headers: Headers,
    pub uri: RequestUri,
    pub version: HttpVersion,
    // some fields omitted
}

A request bundles several parts of an incoming NetworkStream, given to a Handler.

Fields

remote_addr

The IP address of the remote connection.

method

The Method, such as Get, Post, etc.

headers

The headers of the incoming request.

uri

The target request-uri for this request.

version

The version of HTTP for this request.

Methods

impl<'a> Request<'a>

fn new(stream: &'a mut Read + 'a, addr: SocketAddr) -> HttpResult<Request<'a>>

Create a new Request, reading the StartLine and Headers so they are immediately useful.

fn deconstruct(self) -> (SocketAddr, Method, Headers, RequestUri, HttpVersion, HttpReader<&'a mut Read + 'a>)

Deconstruct a Request into its constituent parts.

Trait Implementations

impl<'a> Read for Request<'a>

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

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<(), Error>

fn read_to_string(&mut self, buf: &mut String) -> Result<(), Error>