[][src]Struct nickel::Mount

pub struct Mount<M> { /* fields omitted */ }

Methods

impl<M> Mount<M>
[src]

pub fn new<S: Into<String>>(mount_point: S, middleware: M) -> Mount<M>
[src]

Creates a new middleware that mounts a middleware at a mount point. An incoming request that matches the mount point will be forwareded to the mounted middleware, but with the path rewritten so that the mount point appears to be the root from the perspective of the mounted middleware. This can be useful in combination with the StaticFilesMiddleware, for example.

Examples

use nickel::{Nickel, StaticFilesHandler, Mount};
let mut server = Nickel::new();

server.utilize(
    Mount::new("/static_files/",
               StaticFilesHandler::new("/path/to/serve/")
));

Panics

Panics if mount_point does not have a leading and trailing slash.

Trait Implementations

impl<D, M: Middleware<D>> Middleware<D> for Mount<M>
[src]

Auto Trait Implementations

impl<M> Send for Mount<M> where
    M: Send

impl<M> Sync for Mount<M> where
    M: Sync

Blanket Implementations

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

impl<T> From for T
[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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.

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

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> UnsafeAny for T where
    T: Any