pub struct Request { /* private fields */ }Expand description
The Request that get’s returned to every route.
Implementations
sourceimpl Request
impl Request
sourcepub fn take_body(&mut self) -> BodyWithTimeout
pub fn take_body(&mut self) -> BodyWithTimeout
Takes the current body and leaves the request with an empty body.
sourcepub fn take_raw_body(&mut self) -> Body
pub fn take_raw_body(&mut self) -> Body
Takes the current body and leaves the request an empty body.
This discard the timout associated with the body.
sourcepub fn body(&self) -> &BodyWithTimeout
pub fn body(&self) -> &BodyWithTimeout
Returns a reference to the body contained in the request.
sourcepub fn body_mut(&mut self) -> &mut BodyWithTimeout
pub fn body_mut(&mut self) -> &mut BodyWithTimeout
Returns a mutable reference to the body contained in the request.
sourcepub fn raw_body(&self) -> &Body
pub fn raw_body(&self) -> &Body
Returns a reference to the body contained in the request without a timeout being associated with it.
sourcepub fn raw_body_mut(&mut self) -> &mut Body
pub fn raw_body_mut(&mut self) -> &mut Body
Returns a reference to the body contained in the request without a timeout being associated with it.
sourcepub fn set_size_limit(&mut self, size_limit: usize)
pub fn set_size_limit(&mut self, size_limit: usize)
Changes the size limit of the current request.
sourcepub fn set_timeout(&mut self, duration: Duration)
pub fn set_timeout(&mut self, duration: Duration)
Changes the timeout of the current request.
sourcepub fn header(&self) -> &RequestHeader
pub fn header(&self) -> &RequestHeader
Returns a reference to the request header.
sourcepub fn header_mut(&mut self) -> &mut RequestHeader
pub fn header_mut(&mut self) -> &mut RequestHeader
Returns a mutable reference to the request header.
sourcepub async fn deserialize<D>(&mut self) -> Result<D> where
D: DeserializeOwned,
pub async fn deserialize<D>(&mut self) -> Result<D> where
D: DeserializeOwned,
Trait Implementations
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more