docs.rs failed to build mrmime-0.0.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
mrmime-0.0.1
mrmime
A small MIME type registry for Rust that allows easy lookup by MIME type string or file extension.
Why? Most apps only handle a small number of MIME types. This crate lets you declare exactly what you support and treats everything else as invalid. This is important in web applications that receive input from untrusted sources.
TODO: Generate built-in list from IANA media types or mime-db
Installation
Add this to your Cargo.toml:
[]
= "0.1"
A small curated set of common types ships by default via the builtin feature.
If you want to fully control which types are accepted, disable default features:
[]
= { = "0.1", = false } # no built-ins
We also support optional features for serde and diesel.
[]
= "0.1"
= ["serde", "diesel"]
Usage
use ;
use FromStr;
// Built-ins are already present by default; you can add or replace by
// disabling default features (see above) and registering explicitly:
register_mime!
Built-in constants
When the builtin feature is enabled (default), you can refer to common types
via exported constants:
use ;
assert_eq!;
assert_eq!;
assert_eq!;
Tests
cargo test --all-features