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

pub struct Request<'a, 'b: '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: SocketAddr

The IP address of the remote connection.

method: Method

The Method, such as Get, Post, etc.

headers: Headers

The headers of the incoming request.

uri: RequestUri

The target request-uri for this request.

version: HttpVersion

The version of HTTP for this request.

Implementations

impl<'a, 'b: 'a> Request<'a, 'b>[src]

pub fn new(
    stream: &'a mut BufReader<&'b mut dyn NetworkStream>,
    addr: SocketAddr
) -> Result<Request<'a, 'b>>
[src]

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

pub fn set_read_timeout(&self, timeout: Option<Duration>) -> Result<()>[src]

Set the read timeout of the underlying NetworkStream.

pub fn downcast_ref<T: NetworkStream>(&self) -> Option<&T>[src]

Get a reference to the underlying NetworkStream.

pub fn ssl<T: NetworkStream>(&self) -> Option<&T>[src]

Get a reference to the underlying Ssl stream, if connected over HTTPS.

This is actually just an alias for downcast_ref.

pub fn deconstruct(
    self
) -> (SocketAddr, Method, Headers, RequestUri, HttpVersion, HttpReader<&'a mut BufReader<&'b mut dyn NetworkStream>>)
[src]

Deconstruct a Request into its constituent parts.

Trait Implementations

impl<'a, 'b> Read for Request<'a, 'b>[src]

Auto Trait Implementations

impl<'a, 'b> !RefUnwindSafe for Request<'a, 'b>

impl<'a, 'b> Send for Request<'a, 'b>

impl<'a, 'b> !Sync for Request<'a, 'b>

impl<'a, 'b> Unpin for Request<'a, 'b> where
    'b: 'a, 

impl<'a, 'b> !UnwindSafe for Request<'a, 'b>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<R> ReadBytesExt for R where
    R: Read + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any
[src]