pub struct Mount<M> { /* fields omitted */ }
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.
use nickel::{Nickel, StaticFilesHandler, Mount};
let mut server = Nickel::new();
server.utilize(
Mount::new("/static_files/",
StaticFilesHandler::new("/path/to/serve/")
));
Panics if mount_point does not have a leading and trailing slash.
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
impl<T> Typeable for T where T: Any, | |
Get the TypeId
of this object.
impl<T> UnsafeAny for T where T: Any, | |