Struct nickel::StaticFilesHandler
source · pub struct StaticFilesHandler { /* private fields */ }
Implementations
sourceimpl StaticFilesHandler
impl StaticFilesHandler
sourcepub fn new<P: AsRef<Path>>(root_path: P) -> StaticFilesHandler
pub fn new<P: AsRef<Path>>(root_path: P) -> StaticFilesHandler
Create a new middleware to serve files from within a given root directory. The file to serve will be determined by combining the requested Url with the provided root directory.
Examples
use nickel::{Nickel, StaticFilesHandler};
let mut server = Nickel::new();
server.utilize(StaticFilesHandler::new("/path/to/serve/"));
Trait Implementations
sourceimpl Clone for StaticFilesHandler
impl Clone for StaticFilesHandler
sourcefn clone(&self) -> StaticFilesHandler
fn clone(&self) -> StaticFilesHandler
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<D> Middleware<D> for StaticFilesHandler
impl<D> Middleware<D> for StaticFilesHandler
fn invoke<'a>(
&self,
req: &mut Request<'_, '_, D>,
res: Response<'a, D>
) -> MiddlewareResult<'a, D>
Auto Trait Implementations
impl RefUnwindSafe for StaticFilesHandler
impl Send for StaticFilesHandler
impl Sync for StaticFilesHandler
impl Unpin for StaticFilesHandler
impl UnwindSafe for StaticFilesHandler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more