logo
pub struct ServiceRequest { /* private fields */ }
Expand description

A service level request wrapper.

Allows mutable access to request’s internal structures.

Implementations

Deconstruct request into parts

Get mutable access to inner HttpRequest and Payload

Construct request from parts.

Construct request from request.

The returned ServiceRequest would have no payload.

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.

Counterpart to HttpRequest::query_string.

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.

To get client connection information ConnectionInfo should be used.

Will only return None when called in unit tests.

Get ConnectionInfo for the current request.

Returns 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.

Returns a mutable reference to the Path parameters.

Counterpart to HttpRequest::match_name.

Get a reference to a ResourceMap of current application.

Service configuration

Counterpart to HttpRequest::app_data.

Counterpart to HttpRequest::conn_data.

Return request cookie.

Set request payload.

Add data container to request’s resolution set.

In middleware, prefer extensions_mut for request-local data since it is assumed that the same app data is presented for every request.

Creates a context object for use with a guard.

Useful if you are implementing

Trait Implementations

Formats the value using the given formatter. Read more

Type of message payload stream

Read the message headers.

Returns a reference to the request-local data/extensions container.

Returns a mutable reference to the request-local data/extensions container.

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.

Type of resource’s path returned in resource_path.

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.

Responses produced by the service.

Errors produced by the service.

The TransformService value created by this factory

Errors produced while building a transform service.

The future response value.

Creates and returns a new Transform component, asynchronously

Responses produced by the service.

Errors produced by the service.

The TransformService value created by this factory

Errors produced while building a transform service.

The future response value.

Creates and returns a new Transform component, asynchronously

Responses produced by the service.

Errors produced by the service.

The TransformService value created by this factory

Errors produced while building a transform service.

The future response value.

Creates and returns a new Transform component, asynchronously

Responses produced by the service.

Errors produced by the service.

The TransformService value created by this factory

Errors produced while building a transform service.

The future response value.

Creates and returns a new Transform component, asynchronously

Responses produced by the service.

Errors produced by the service.

The TransformService value created by this factory

Errors produced while building a transform service.

The future response value.

Creates and returns a new Transform component, 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