Struct nickel::Mount

source ·
pub struct Mount<M> { /* private fields */ }

Implementations

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Get the TypeId of this object.