logo
pub struct Request<P = PayloadStream> { /* private fields */ }
Expand description

An HTTP request.

Implementations

Create new Request instance

Create new Request instance

Create new Request instance

Get request’s payload

Get request’s payload

Split request into request head and payload

Http message part of the request

Mutable reference to the message’s headers.

Request’s uri.

Mutable reference to the request’s uri.

Read the Request method.

Read the Request Version.

The target path of this Request.

Check if request requires connection upgrade

Peer socket address.

Peer address is the directly connected peer’s socket address. If a proxy is used in front of the Actix Web server, then it would be address of this proxy.

Will only return None when called in unit tests.

Returns a reference a piece of connection data set in an on-connect callback.

let opt_t = req.conn_data::<PeerCertificate>();

Returns the connection data container if an on-connect callback was registered.

Returns the request data container, leaving an empty one in it’s place.

Trait Implementations

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Request extensions

Mutable reference to a the request’s extensions

Type of message payload stream

Read the message headers.

Message payload stream

Read the request content type. If request did not contain a Content-Type header, an empty string is returned. Read more

Get content type encoding Read more

Convert the request content type to a known mime type.

Check if request has chunked transfer encoding.

Responses given by the service.

Errors produced by the service when polling readiness or executing call.

The future response value.

Returns Ready when the service is able to process requests. Read more

Process the request and return the response asynchronously. Read more

Responses given by the created services.

Errors produced by the created services.

Service factory configuration.

The kind of Service created by this factory.

Errors potentially raised while building a service.

The future of the Service instance.g

Create and return a new service asynchronously.

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more