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

pub struct ServiceRequest<P = PayloadStream> { /* fields omitted */ }

Methods

impl<P> ServiceRequest<P>[src]

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

Construct service request from parts

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

Deconstruct request into parts

pub fn into_response<B>(self, res: Response<B>) -> 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_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 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]

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

Service configuration

Methods from Deref<Target = RequestHead>

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

Message extensions

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

Mutable reference to a the message's extensions

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

Read the message headers.

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

Mutable reference to the message headers.

pub fn set_connection_type(&mut self, ctype: ConnectionType)[src]

Set connection type of the message

pub fn connection_type(&self) -> ConnectionType[src]

Connection type

pub fn upgrade(&self) -> bool[src]

Connection upgrade status

pub fn chunked(&self) -> bool[src]

Get response body chunking state

pub fn no_chunking(&mut self, val: bool)[src]

Trait Implementations

impl<P> DerefMut for ServiceRequest<P>[src]

impl<P> Debug for ServiceRequest<P>[src]

impl<P> Deref for ServiceRequest<P>[src]

type Target = RequestHead

The resulting type after dereferencing.

impl<P> HttpMessage for ServiceRequest<P>[src]

type Stream = P

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

fn content_type(&self) -> &str[src]

Read the request content type. If request does not contain Content-Type header, empty str get returned. Read more

fn encoding(
    &self
) -> Result<&'static (dyn Encoding + 'static + Sync + Send), ContentTypeError>
[src]

Get content type encoding Read more

fn mime_type(&self) -> Result<Option<Mime>, ContentTypeError>[src]

Convert the request content type to a known mime type.

fn chunked(&self) -> Result<bool, ParseError>[src]

Check if request has chunked transfer encoding

fn cookies(&self) -> Result<Ref<Vec<Cookie<'static>>>, ParseError>[src]

Load request cookies.

fn cookie(&self, name: &str) -> Option<Cookie<'static>>[src]

Return request cookie.

impl<P> Resource<Url> for ServiceRequest<P>[src]

Auto Trait Implementations

impl<P = Box<dyn Stream<Item = Bytes, Error = PayloadError> + 'static>> !Send for ServiceRequest<P>

impl<P = Box<dyn Stream<Item = Bytes, Error = PayloadError> + 'static>> !Sync for ServiceRequest<P>

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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<T> Erased for T