logo

Struct actix_web::dev::ServiceRequest[][src]

pub struct ServiceRequest(_);
Expand description

An service http request

ServiceRequest allows mutable access to request’s internal structures

Implementations

Deconstruct request into parts

Construct request from parts.

ServiceRequest can be re-constructed only if req hasn’t been cloned.

Construct request from request.

HttpRequest implements Clone trait via Rc type. ServiceRequest can be re-constructed only if rc’s strong pointers count eq 1 and weak pointers count is 0.

Create service response

Create service response for error

This method returns reference to the request head

This method returns reference to the request head

Request’s uri.

Read the Request method.

Read the Request Version.

Returns request’s headers.

Returns mutable request’s headers.

The target path of this Request.

The query string in the URL.

E.g., id=10

Peer socket address

Peer address is actual socket address, if proxy is used in front of actix http server, then peer address would be address of this proxy.

To get client connection information ConnectionInfo should be used.

Get ConnectionInfo for the current request.

Get a reference to the Path parameters.

Params is a container for url parameters. A variable segment is specified in the form {identifier}, where the identifier can be used later in a request handler to access the matched value for that segment.

Counterpart to HttpRequest::match_name.

Get a mutable reference to the Path parameters.

Get a reference to a ResourceMap of current application.

Service configuration

Counterpart to HttpRequest::app_data.

Set request payload.

Trait Implementations

Formats the value using the given formatter. Read more

Returns Request’s headers.

Request extensions

Mutable reference to a the request’s extensions

Type of message payload stream

Message payload stream

Read the request content type. If request does not contain Content-Type header, empty str get 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

Load request cookies.

Return request cookie.

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

Performs the conversion.

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

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

Performs the conversion.

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