Please check build logs and if you believe this is docs.rs' fault, report into this issue report.
Static file-serving handler for the Iron web framework.
This example uses the mounting handler to serve files from several directories.
let mut mount = Mount::new(); // Serve the shared JS/CSS at / mount.mount("/", Static::new(Path::new("target/doc/"))); // Serve the static file docs at /doc/ mount.mount("/doc/", Static::new(Path::new("target/doc/static/"))); // Serve the source code at /src/ mount.mount("/src/", Static::new(Path::new("target/doc/src/static/lib.rs.html"))); Iron::new(mount).listen(Ipv4Addr(127, 0, 0, 1), 3000).unwrap();
static is a reserved keyword, so the crate will need to be imported as
extern crate "static" as static_file;.
examples/doc_server.rs for a complete example that you can compile.
static is a part of Iron's core bundle.
- Serve static files from a given path.
It works well in combination with the mounting handler.
If you're using a
Cargo.toml to manage dependencies, just add the
static package to the toml:
[dependencies.static] git = "https://github.com/iron/static.git"
cargo build, and the rlib will be in your
Along with the online documentation,
you can build a local copy with