pub struct Request { /* private fields */ }
Expand description
Request’s context
Implementations
sourceimpl Request
impl Request
sourcepub fn headers_mut(&mut self) -> &mut HeaderMap
pub fn headers_mut(&mut self) -> &mut HeaderMap
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
sourceimpl HttpMessage for Request
impl HttpMessage for Request
sourcefn 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
sourcefn encoding(&self) -> Result<EncodingRef, ContentTypeError>
fn encoding(&self) -> Result<EncodingRef, ContentTypeError>
Get content type encoding Read more
sourcefn 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.
sourcefn chunked(&self) -> Result<bool, ParseError>
fn chunked(&self) -> Result<bool, ParseError>
Check if request has chunked transfer encoding
sourcefn body(&self) -> MessageBody<Self>
fn body(&self) -> MessageBody<Self>
Load http message body. Read more
sourcefn urlencoded<T: DeserializeOwned>(&self) -> UrlEncoded<Self, T>
fn urlencoded<T: DeserializeOwned>(&self) -> UrlEncoded<Self, T>
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 moresourcefn json<T: DeserializeOwned>(&self) -> JsonBody<Self, T>
fn json<T: DeserializeOwned>(&self) -> JsonBody<Self, T>
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more