pub struct HttpRequest<IO: AsyncRead + AsyncWrite + Unpin> { /* private fields */ }

Implementations

Direct access to the request as http::Request with body decoder and underlying transport. The transport may be extracted using

let transport = request.into_inner();

Doing this after starting to read the body may lead to one of these situations:

  • The meaning of remaining data read from the transport is ambiguous, if the body has been partially consumed and is encoded using chunked transfer encoding.
  • If the request includes the Expect: 100-continue header and if the body reader has been polled, but did not yield any data yet, the informational response 100 Continue may have been fully, partially or not sent on the transport.

Reasoning about the protocol state is only trivial before calling Self::body() and after consuming the whole body.

The inverse of Self::into_inner().

Move on to responding after consuming and discarding the remaining request body data.

Access the request body data stream as [futures::io::AsyncRead]. If the request includes the Expect: 100-continue the informational response 100 Continue will be sent to the client before the reader emits any body data.

Read whole body as String. See Self::body for details.

Read whole body as Vec. See Self::body for details.

Access the headers as http::HeaderMap.

Access the URI as http::Uri.

Return the method as http::Method.

Return the HTTP version as http::Version.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.