[−][src]Enum saphir::http_context::State
State of the Http context. It represent whether the context is used
Before(..)
or After(..)
calling the handler responsible of generating a
responder. Empty will be the state of a context when the request is being
processed by the handler, or when its original state has been moved by using
take & take unchecked methods
Variants
Implementations
impl State
[src]
pub fn take(&mut self) -> Self
[src]
Take the current context leaving State::Empty
behind
pub fn take_request(&mut self) -> Option<Request>
[src]
Take the current request leaving State::Empty
behind
Returns Some(Request)
if the state was Before
or None
if it was
something else
pub fn take_request_unchecked(&mut self) -> Request
[src]
pub fn take_response(&mut self) -> Option<Response>
[src]
Take the current response leaving State::Empty
behind
Returns Some(Response)
if the state was After
or None
if it was
something else
pub fn take_response_unchecked(&mut self) -> Response
[src]
pub fn request(&self) -> Option<&Request>
[src]
Returns Some
of the current request if state if Before
pub fn request_mut(&mut self) -> Option<&Request>
[src]
Returns Some
of the current request as a mutable ref if state if
Before
pub fn request_unchecked(&self) -> &Request
[src]
pub fn request_unchecked_mut(&mut self) -> &mut Request
[src]
pub fn response(&self) -> Option<&Response>
[src]
Returns Some
of the current response if state if After
pub fn response_mut(&mut self) -> Option<&mut Response>
[src]
Returns Some
of the current response as a mutable ref if state if
After
pub fn response_unchecked(&self) -> &Response
[src]
pub fn response_unchecked_mut(&mut self) -> &mut Response
[src]
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl !UnwindSafe for State
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,