Struct pemmican::plugins::htdocs::Htdocs [−][src]
pub struct Htdocs { /* fields omitted */ }
This plugin serves static files from a document root.
If a previous router handler has already set a body, this plugin will take no action. It will only serve files if the path matches and the response body has not yet been set.
Methods
impl Htdocs
[src]
impl Htdocs
pub fn new<P>(docroot: P, index: Option<String>) -> Htdocs where
PathBuf: From<P>,
[src]
pub fn new<P>(docroot: P, index: Option<String>) -> Htdocs where
PathBuf: From<P>,
Create a new Htdocs plugin with the given document root.
index
is the file to search for in case a directory is specified,
e.g. Some(index.html
) or simply None if directories are not to be
matched.
Trait Implementations
impl<S, E> Plugin<S, E> for Htdocs where
S: Send + Sync + 'static,
E: Send + 'static,
[src]
impl<S, E> Plugin<S, E> for Htdocs where
S: Send + Sync + 'static,
E: Send + 'static,
ⓘImportant traits for Box<R>fn handle(
&self,
data: PluginData<S>
) -> Box<Future<Item = PluginData<S>, Error = E>>
[src]
ⓘImportant traits for Box<R>
fn handle(
&self,
data: PluginData<S>
) -> Box<Future<Item = PluginData<S>, Error = E>>