[][src]Trait nickel::Mountable

pub trait Mountable<D> {
    fn mount<S: Into<String>, M: Middleware<D>>(
        &mut self,
        mount_point: S,
        middleware: M
    ); }

Required methods

fn mount<S: Into<String>, M: Middleware<D>>(
    &mut self,
    mount_point: S,
    middleware: M
)

Loading content...

Implementors

impl<D> Mountable<D> for Nickel<D> where
    D: Send + Sync + 'static, 
[src]

fn mount<S: Into<String>, M: Middleware<D>>(
    &mut self,
    mount_point: S,
    middleware: M
)
[src]

A trait that makes mounting more convenient. Works the same as manually adding a Mount middleware.

Examples

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

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

Panics

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

Loading content...