Struct multipart::server::nickel::NickelRequest [−][src]
pub struct NickelRequest<'mw, 'server, D = ()> where
'server: 'mw,
D: 'mw, { pub origin: Request<'mw, 'server>, pub route_result: Option<RouteResult<'mw, D>>, // some fields omitted }
Expand description
A container for all the request data.
The lifetime 'mw
represents the lifetime of various bits of
middleware state within nickel. It can vary and get shorter.
The lifetime 'server
represents the lifetime of data internal to
the server. It is fixed and longer than 'mw
.
Fields
origin: Request<'mw, 'server>
the original hyper::server::Request
route_result: Option<RouteResult<'mw, D>>
a HashMap<String, String>
holding all params with names and values
Implementations
Trait Implementations
impl<'r, 'mw: 'r, 'server: 'mw, D: 'mw> AsMut<&'r mut Request<'mw, 'server, D>> for Maybe<'r, 'mw, 'server, D>
[src]
impl<'r, 'mw: 'r, 'server: 'mw, D: 'mw> AsMut<&'r mut Request<'mw, 'server, D>> for Maybe<'r, 'mw, 'server, D>
[src]fn as_mut(&mut self) -> &mut &'r mut NickelRequest<'mw, 'server, D>
[src]
fn as_mut(&mut self) -> &mut &'r mut NickelRequest<'mw, 'server, D>
[src]Performs the conversion.
impl<'r, 'mw: 'r, 'server: 'mw, D: 'mw> AsRef<&'r mut Request<'mw, 'server, D>> for Maybe<'r, 'mw, 'server, D>
[src]
impl<'r, 'mw: 'r, 'server: 'mw, D: 'mw> AsRef<&'r mut Request<'mw, 'server, D>> for Maybe<'r, 'mw, 'server, D>
[src]fn as_ref(&self) -> &&'r mut NickelRequest<'mw, 'server, D>
[src]
fn as_ref(&self) -> &&'r mut NickelRequest<'mw, 'server, D>
[src]Performs the conversion.
impl<'mw, 'server, D> Extensible for Request<'mw, 'server, D>
[src]
impl<'mw, 'server, D> Extensible for Request<'mw, 'server, D>
[src]pub fn extensions(&self) -> &TypeMap<dyn UnsafeAny + 'static>
[src]
pub fn extensions(&self) -> &TypeMap<dyn UnsafeAny + 'static>
[src]Get a reference to the type’s extension storage.
pub fn extensions_mut(&mut self) -> &mut TypeMap<dyn UnsafeAny + 'static>
[src]
pub fn extensions_mut(&mut self) -> &mut TypeMap<dyn UnsafeAny + 'static>
[src]Get a mutable reference to the type’s extension storage.
impl<'r, 'mw: 'r, 'server: 'mw, D: 'mw> From<&'r mut Request<'mw, 'server, D>> for Maybe<'r, 'mw, 'server, D>
[src]
impl<'r, 'mw: 'r, 'server: 'mw, D: 'mw> From<&'r mut Request<'mw, 'server, D>> for Maybe<'r, 'mw, 'server, D>
[src]fn from(req: &'r mut NickelRequest<'mw, 'server, D>) -> Self
[src]
fn from(req: &'r mut NickelRequest<'mw, 'server, D>) -> Self
[src]Performs the conversion.
impl<'r, 'mw: 'r, 'server: 'mw, D: 'mw> Into<&'r mut Request<'mw, 'server, D>> for Maybe<'r, 'mw, 'server, D>
[src]
impl<'r, 'mw: 'r, 'server: 'mw, D: 'mw> Into<&'r mut Request<'mw, 'server, D>> for Maybe<'r, 'mw, 'server, D>
[src]fn into(self) -> &'r mut NickelRequest<'mw, 'server, D>
[src]
fn into(self) -> &'r mut NickelRequest<'mw, 'server, D>
[src]Performs the conversion.
impl<'mw, 'conn, D> JsonBody for Request<'mw, 'conn, D>
[src]
impl<'mw, 'conn, D> JsonBody for Request<'mw, 'conn, D>
[src]pub fn json_as<'a, T>(&'a mut self) -> Result<T, Error> where
T: Deserialize<'a>,
[src]
T: Deserialize<'a>,
impl<'mw, 'server, D: 'mw> MultipartBody<'mw, 'server> for NickelRequest<'mw, 'server, D>
[src]
impl<'mw, 'server, D: 'mw> MultipartBody<'mw, 'server> for NickelRequest<'mw, 'server, D>
[src]fn multipart_body(
&mut self
) -> Option<Multipart<&mut HyperRequest<'mw, 'server>>>
[src]
fn multipart_body(
&mut self
) -> Option<Multipart<&mut HyperRequest<'mw, 'server>>>
[src]Get a multipart reader for the request body, if the request is of the right type.
impl<'mw, 'server, D> Pluggable for Request<'mw, 'server, D>
[src]
impl<'mw, 'server, D> Pluggable for Request<'mw, 'server, D>
[src]fn get<P>(&mut self) -> Result<<P as Key>::Value, <P as Plugin<Self>>::Error> where
Self: Extensible,
P: Plugin<Self>,
<P as Key>::Value: Clone,
<P as Key>::Value: Any,
fn get<P>(&mut self) -> Result<<P as Key>::Value, <P as Plugin<Self>>::Error> where
Self: Extensible,
P: Plugin<Self>,
<P as Key>::Value: Clone,
<P as Key>::Value: Any,
Return a copy of the plugin’s produced value. Read more
fn get_ref<P>(
&mut self
) -> Result<&<P as Key>::Value, <P as Plugin<Self>>::Error> where
Self: Extensible,
P: Plugin<Self>,
<P as Key>::Value: Any,
fn get_ref<P>(
&mut self
) -> Result<&<P as Key>::Value, <P as Plugin<Self>>::Error> where
Self: Extensible,
P: Plugin<Self>,
<P as Key>::Value: Any,
Return a reference to the plugin’s produced value. Read more
impl<'mw, 'conn, D> QueryString for Request<'mw, 'conn, D>
[src]
impl<'mw, 'conn, D> QueryString for Request<'mw, 'conn, D>
[src]impl<'mw, 'server, D> Referer for Request<'mw, 'server, D>
[src]
impl<'mw, 'server, D> Referer for Request<'mw, 'server, D>
[src]pub fn referer(&self) -> Option<&str>
[src]
pub fn referer(&self) -> Option<&str>
[src]Get the Request’s referer header
Examples
extern crate nickel; use nickel::{Nickel, HttpRouter, Request, Response, MiddlewareResult}; use nickel::extensions::{Referer, Redirect}; fn referer<'mw, 'conn>(req: &mut Request<'mw, 'conn>, res: Response<'mw>) -> MiddlewareResult<'mw> { let back = req.referer().unwrap_or("http://nickel-org.github.io/"); return res.redirect(back) } fn main() { let mut server = Nickel::new(); server.get("/a", referer); }
Auto Trait Implementations
impl<'mw, 'server, D = ()> !RefUnwindSafe for Request<'mw, 'server, D>
impl<'mw, 'server, D = ()> !Send for Request<'mw, 'server, D>
impl<'mw, 'server, D = ()> !Sync for Request<'mw, 'server, D>
impl<'mw, 'server, D> Unpin for Request<'mw, 'server, D> where
'server: 'mw,
'server: 'mw,
impl<'mw, 'server, D = ()> !UnwindSafe for Request<'mw, 'server, D>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> UnsafeAny for T where
T: Any,
T: Any,