Struct ntex::web::WebRequest[][src]

pub struct WebRequest<Err> { /* fields omitted */ }
Expand description

An service http request

WebRequest allows mutable access to request’s internal structures

Implementations

Create web response for error

Create web response for error

Deconstruct request into parts

Construct request from parts.

WebRequest can be re-constructed only if req hasnt been cloned.

Construct request from request.

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

Create web response

Io reference for current connection

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

Get a mutable reference to the Path parameters.

Get a reference to a ResourceMap of current application.

Service configuration

Get an application data stored with App::app_data() method during application configuration.

To get data stored with App::data() use web::types::Data<T> as type.

Get request’s payload

Set request payload.

Request extensions

Mutable reference to a the request’s extensions

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

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.

Responses given by the service

Errors produced by the service

Errors produced while building a service.

The Service value created by this factory

The future of the ServiceFactory instance.

Create and return a new service value asynchronously.

Map this service’s output to a different type, returning a new service of the resulting type. Read more

Map this service’s error to a different error, returning a new service.

Map this factory’s init error to a different error, returning a new service.

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

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