[][src]Struct saphir::http_context::HttpContext

pub struct HttpContext {
    pub state: State,
    // some fields omitted
}

Context representing the relationship between a request and a response This structure only appears inside Middleware since the act before and after the request

There is no guaranty the the request nor the response will be set at any given time, since they could be moved out by a badly implemented middleware

Fields

state: State

The incoming request Before it is handled by the router OR The outgoing response After the request was handled by the router

Implementations

impl HttpContext[src]

pub fn before(&mut self, request: Request)[src]

Explicitly set the inner state to Before with the given response

pub fn after(&mut self, response: Response)[src]

Explicitly set the inner state to After with the given response

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.