[−][src]Struct hyper::server::request::Request
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.
Methods
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][−]
stream: &'a mut BufReader<&'b mut dyn NetworkStream>,
addr: SocketAddr
) -> Result<Request<'a, 'b>>
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][−]
self
) -> (SocketAddr, Method, Headers, RequestUri, HttpVersion, HttpReader<&'a mut BufReader<&'b mut dyn NetworkStream>>)
Deconstruct a Request into its constituent parts.
Trait Implementations
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,
'b: 'a,
impl<'a, 'b> !UnwindSafe for Request<'a, 'b>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<R> ReadBytesExt for R where
R: Read + ?Sized,
[src][+]
R: Read + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<T> Typeable for T where
T: Any,
[src][+]
T: Any,