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

pub struct ServiceRequest(_);

An service http request

ServiceRequest allows mutable access to request's internal structures

Methods

impl ServiceRequest[src]

pub fn into_parts(self) -> (HttpRequest, Payload)[src]

Deconstruct request into parts

pub fn from_parts(
    req: HttpRequest,
    pl: Payload
) -> Result<Self, (HttpRequest, Payload)>
[src]

Construct request from parts.

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

pub fn from_request(req: HttpRequest) -> Result<Self, HttpRequest>[src]

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.

pub fn into_response<B, R: Into<Response<B>>>(
    self,
    res: R
) -> ServiceResponse<B>
[src]

Create service response

pub fn error_response<B, E: Into<Error>>(self, err: E) -> ServiceResponse<B>[src]

Create service response for error

pub fn head(&self) -> &RequestHead[src]

This method returns reference to the request head

pub fn head_mut(&mut self) -> &mut RequestHead[src]

This method returns reference to the request head

pub fn uri(&self) -> &Uri[src]

Request's uri.

pub fn method(&self) -> &Method[src]

Read the Request method.

pub fn version(&self) -> Version[src]

Read the Request Version.

pub fn headers(&self) -> &HeaderMap[src]

Returns request's headers.

pub fn headers_mut(&mut self) -> &mut HeaderMap[src]

Returns mutable request's headers.

pub fn path(&self) -> &str[src]

The target path of this Request.

pub fn query_string(&self) -> &str[src]

The query string in the URL.

E.g., id=10

pub fn peer_addr(&self) -> Option<SocketAddr>[src]

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.

pub fn connection_info(&self) -> Ref<ConnectionInfo>[src]

Get ConnectionInfo for the current request.

pub fn match_info(&self) -> &Path<Url>[src]

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.

pub fn match_info_mut(&mut self) -> &mut Path<Url>[src]

Get a mutable reference to the Path parameters.

pub fn resource_map(&self) -> &ResourceMap[src]

Get a reference to a ResourceMap of current application.

pub fn app_config(&self) -> &AppConfig[src]

Service configuration

pub fn app_data<T: 'static>(&self) -> Option<Data<T>>[src]

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

pub fn set_payload(&mut self, payload: Payload)[src]

Set request payload.

Trait Implementations

impl Debug for ServiceRequest[src]

impl HttpMessage for ServiceRequest[src]

type Stream = PayloadStream

Type of message payload stream

fn headers(&self) -> &HeaderMap[src]

Returns Request's headers.

fn extensions(&self) -> Ref<Extensions>[src]

Request extensions

fn extensions_mut(&self) -> RefMut<Extensions>[src]

Mutable reference to a the request's extensions

impl Resource<Url> for ServiceRequest[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,