Struct webmachine::context::Context
source · [−]pub struct Context {
pub request: Request,
pub response: Response,
pub selected_media_type: Option<String>,
pub selected_language: Option<String>,
pub selected_charset: Option<String>,
pub selected_encoding: Option<String>,
pub if_unmodified_since: Option<DateTime<FixedOffset>>,
pub if_modified_since: Option<DateTime<FixedOffset>>,
pub redirect: bool,
pub new_resource: bool,
pub metadata: HashMap<String, String>,
}
Expand description
Main context struct that holds the request and response.
Fields
request: Request
Request that the webmachine is executing against
response: Response
Response that is the result of the execution
selected_media_type: Option<String>
selected media type after content negotiation
selected_language: Option<String>
selected language after content negotiation
selected_charset: Option<String>
selected charset after content negotiation
selected_encoding: Option<String>
selected encoding after content negotiation
if_unmodified_since: Option<DateTime<FixedOffset>>
parsed date and time from the If-Unmodified-Since header
if_modified_since: Option<DateTime<FixedOffset>>
parsed date and time from the If-Modified-Since header
redirect: bool
If the response should be a redirect
new_resource: bool
If a new resource was created
metadata: HashMap<String, String>
General store of metadata. You can use this to store attributes as the webmachine executes.
Trait Implementations
impl StructuralPartialEq for Context
Auto Trait Implementations
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
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