[][src]Struct multipart::server::nickel::HyperRequest

pub struct HyperRequest<'a, 'b> where
    '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> Request<'a, 'b> where
    'b: 'a, 
[src]

pub fn new(
    stream: &'a mut BufReader<&'b mut (dyn NetworkStream + 'static)>,
    addr: SocketAddr
) -> Result<Request<'a, 'b>, Error>
[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<(), Error>[src]

Set the read timeout of the underlying NetworkStream.

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

Get a reference to the underlying NetworkStream.

pub fn ssl<T>(&self) -> Option<&T> where
    T: NetworkStream
[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 + 'static)>>)
[src]

Deconstruct a Request into its constituent parts.

Trait Implementations

impl<'a, 'b> HttpRequest for HyperRequest<'a, 'b>[src]

type Body = Self

The body of this request.

impl<'r, 'a, 'b> HttpRequest for &'r mut HyperRequest<'a, 'b>[src]

type Body = Self

The body of this request.

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

Auto Trait Implementations

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

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

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

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

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

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

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

impl<T> UnsafeAny for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,