[−][src]Struct multipart::server::nickel::NickelRequest
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
Methods
impl<'mw, 'server, D> Request<'mw, 'server, D>
[src]
impl<'mw, 'server, D> Request<'mw, 'server, D>
pub fn from_internal(
req: Request<'mw, 'server>,
data: &'mw D
) -> Request<'mw, 'server, D>
[src]
pub fn from_internal(
req: Request<'mw, 'server>,
data: &'mw D
) -> Request<'mw, 'server, D>
pub fn param(&self, key: &str) -> Option<&str>
[src]
pub fn param(&self, key: &str) -> Option<&str>
pub fn path_without_query(&self) -> Option<&str>
[src]
pub fn path_without_query(&self) -> Option<&str>
pub fn server_data(&self) -> &'mw D
[src]
pub fn server_data(&self) -> &'mw D
Trait Implementations
impl<'mw, 'server, D> Pluggable for Request<'mw, 'server, D>
[src]
impl<'mw, 'server, D> Pluggable for Request<'mw, 'server, D>
fn get<P>(&mut self) -> Result<<P as Key>::Value, <P as Plugin<Self>>::Error> where
P: Plugin<Self>,
Self: Extensible,
<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
P: Plugin<Self>,
Self: Extensible,
<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
P: Plugin<Self>,
Self: Extensible,
<P as Key>::Value: Any,
fn get_ref<P>(
&mut self
) -> Result<&<P as Key>::Value, <P as Plugin<Self>>::Error> where
P: Plugin<Self>,
Self: Extensible,
<P as Key>::Value: Any,
Return a reference to the plugin's produced value. Read more
fn get_mut<P>(
&mut self
) -> Result<&mut <P as Key>::Value, <P as Plugin<Self>>::Error> where
P: Plugin<Self>,
Self: Extensible,
<P as Key>::Value: Any,
fn get_mut<P>(
&mut self
) -> Result<&mut <P as Key>::Value, <P as Plugin<Self>>::Error> where
P: Plugin<Self>,
Self: Extensible,
<P as Key>::Value: Any,
Return a mutable reference to the plugin's produced value. Read more
fn compute<P>(
&mut self
) -> Result<<P as Key>::Value, <P as Plugin<Self>>::Error> where
P: Plugin<Self>,
fn compute<P>(
&mut self
) -> Result<<P as Key>::Value, <P as Plugin<Self>>::Error> where
P: Plugin<Self>,
Create and evaluate a once-off instance of a plugin.
impl<'mw, 'server, D> Extensible for Request<'mw, 'server, D>
[src]
impl<'mw, 'server, D> Extensible for Request<'mw, 'server, D>
fn extensions(&self) -> &TypeMap<dyn UnsafeAny + 'static>
[src]
fn extensions(&self) -> &TypeMap<dyn UnsafeAny + 'static>
fn extensions_mut(&mut self) -> &mut TypeMap<dyn UnsafeAny + 'static>
[src]
fn extensions_mut(&mut self) -> &mut TypeMap<dyn UnsafeAny + 'static>
impl<'mw, 'server, D> Referer for Request<'mw, 'server, D>
[src]
impl<'mw, 'server, D> Referer for Request<'mw, 'server, D>
fn referer(&self) -> Option<&str>
[src]
fn referer(&self) -> Option<&str>
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); }
impl<'mw, 'conn, D> JsonBody for Request<'mw, 'conn, D>
[src]
impl<'mw, 'conn, D> JsonBody for Request<'mw, 'conn, D>
impl<'mw, 'conn, D> QueryString for Request<'mw, 'conn, D>
[src]
impl<'mw, 'conn, D> QueryString for Request<'mw, 'conn, D>
impl<'mw, 'conn, D> FormBody for Request<'mw, 'conn, D>
[src]
impl<'mw, 'conn, D> FormBody for Request<'mw, 'conn, D>
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>
fn multipart_body(
&mut self
) -> Option<Multipart<&mut HyperRequest<'mw, 'server>>>
[src]
fn multipart_body(
&mut self
) -> Option<Multipart<&mut HyperRequest<'mw, 'server>>>
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>
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>
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>
fn as_ref(&self) -> &&'r mut NickelRequest<'mw, 'server, D>
[src]
fn as_ref(&self) -> &&'r mut NickelRequest<'mw, 'server, D>
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>
fn from(req: &'r mut NickelRequest<'mw, 'server, D>) -> Self
[src]
fn from(req: &'r mut NickelRequest<'mw, 'server, D>) -> Self
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>
fn into(self) -> &'r mut NickelRequest<'mw, 'server, D>
[src]
fn into(self) -> &'r mut NickelRequest<'mw, 'server, D>
Auto Trait Implementations
impl<'mw, 'server, D = ()> !Send 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 = ()> !Sync for Request<'mw, 'server, D>
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T> Typeable for T where
T: Any,
impl<T> Typeable for T where
T: Any,
impl<T> UnsafeAny for T where
T: Any,
impl<T> UnsafeAny for T where
T: Any,