pub struct Request { /* private fields */ }
Expand description
Request’s context
Implementations§
source§impl Request
impl Request
sourcepub fn headers(&self) -> &HeaderMap<HeaderValue>
pub fn headers(&self) -> &HeaderMap<HeaderValue>
Returns Request’s headers.
sourcepub fn headers_mut(&mut self) -> &mut HeaderMap<HeaderValue>
pub fn headers_mut(&mut self) -> &mut HeaderMap<HeaderValue>
Returns mutable Request’s headers.
sourcepub fn peer_addr(&self) -> Option<SocketAddr>
pub fn peer_addr(&self) -> Option<SocketAddr>
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 connection_info()
method should
be used.
sourcepub fn keep_alive(&self) -> bool
pub fn keep_alive(&self) -> bool
Checks if a connection should be kept alive.
sourcepub fn extensions(&self) -> Ref<'_, Extensions>
pub fn extensions(&self) -> Ref<'_, Extensions>
Request extensions
sourcepub fn extensions_mut(&self) -> RefMut<'_, Extensions>
pub fn extensions_mut(&self) -> RefMut<'_, Extensions>
Mutable reference to a the request’s extensions
sourcepub fn connection_info(&self) -> Ref<'_, ConnectionInfo>
pub fn connection_info(&self) -> Ref<'_, ConnectionInfo>
Get ConnectionInfo for the correct request.
sourcepub fn stream_extensions(&self) -> Option<&Extensions>
pub fn stream_extensions(&self) -> Option<&Extensions>
Io stream extensions
sourcepub fn server_settings(&self) -> &ServerSettings
pub fn server_settings(&self) -> &ServerSettings
Server settings
Trait Implementations§
source§impl HttpMessage for Request
impl HttpMessage for Request
source§fn headers(&self) -> &HeaderMap<HeaderValue>
fn headers(&self) -> &HeaderMap<HeaderValue>
Read the message headers.
source§fn content_type(&self) -> &str
fn content_type(&self) -> &str
Read the request content type. If request does not contain
Content-Type header, empty str get returned. Read more
source§fn encoding(
&self
) -> Result<&'static (dyn Encoding + Send + Sync + 'static), ContentTypeError>
fn encoding(
&self
) -> Result<&'static (dyn Encoding + Send + Sync + 'static), ContentTypeError>
Get content type encoding Read more
source§fn mime_type(&self) -> Result<Option<Mime>, ContentTypeError>
fn mime_type(&self) -> Result<Option<Mime>, ContentTypeError>
Convert the request content type to a known mime type.
source§fn body(&self) -> MessageBody<Self>
fn body(&self) -> MessageBody<Self>
Load http message body. Read more
source§fn urlencoded<T>(&self) -> UrlEncoded<Self, T>where
T: DeserializeOwned,
fn urlencoded<T>(&self) -> UrlEncoded<Self, T>where
T: DeserializeOwned,
Parse
application/x-www-form-urlencoded
encoded request’s body.
Return UrlEncoded
future. Form can be deserialized to any type that
implements Deserialize
trait from serde. Read moresource§fn json<T>(&self) -> JsonBody<Self, T>where
T: DeserializeOwned,
fn json<T>(&self) -> JsonBody<Self, T>where
T: DeserializeOwned,
Auto Trait Implementations§
impl !RefUnwindSafe for Request
impl !Send for Request
impl !Sync for Request
impl Unpin for Request
impl !UnwindSafe for Request
Blanket Implementations§
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self
to an expression for Diesel’s query builder. Read more