Add notes about enabling features to contrib docs.

This commit is contained in:
Sergio Benitez 2018-12-07 09:07:27 -08:00
parent d3c161e7d6
commit b88a2d7d05
6 changed files with 71 additions and 2 deletions

View File

@ -9,6 +9,18 @@
//! [express]: https://expressjs.com
//! [`SpaceHelmet`]: helmet::SpaceHelmet
//!
//! # Enabling
//!
//! This module is only available when the `helmet` feature is enabled. Enable
//! it in `Cargo.toml` as follows:
//!
//! ```toml
//! [dependencies.rocket_contrib]
//! version = "0.4.0"
//! default-features = false
//! features = ["helmet"]
//! ```
//!
//! # Supported Headers
//!
//! | HTTP Header | Description | Policy | Default? |

View File

@ -1,6 +1,19 @@
//! Automatic JSON (de)serialization support.
//!
//! See the [`Json`](json::Json) type for further details.
//!
//! # Enabling
//!
//! This module is only available when the `json` feature is enabled. Enable it
//! in `Cargo.toml` as follows:
//!
//! ```toml
//! [dependencies.rocket_contrib]
//! version = "0.4.0"
//! default-features = false
//! features = ["json"]
//! ```
extern crate serde;
extern crate serde_json;

View File

@ -1,6 +1,18 @@
//! Automatic MessagePack (de)serialization support.
//!
//! See the [`MsgPack`](msgpack::MessagePack) type for further details.
//!
//! # Enabling
//!
//! This module is only available when the `msgpack` feature is enabled. Enable
//! it in `Cargo.toml` as follows:
//!
//! ```toml
//! [dependencies.rocket_contrib]
//! version = "0.4.0"
//! default-features = false
//! features = ["msgpack"]
//! ```
extern crate serde;
extern crate rmp_serde;

View File

@ -1,4 +1,18 @@
//! Custom handler and options for static file serving.
//!
//! See the [`StaticFiles`](serve::StaticFiles) type for further details.
//!
//! # Enabling
//!
//! This module is only available when the `serve` feature is enabled. Enable it
//! in `Cargo.toml` as follows:
//!
//! ```toml
//! [dependencies.rocket_contrib]
//! version = "0.4.0"
//! default-features = false
//! features = ["serve"]
//! ```
use std::path::{PathBuf, Path};

View File

@ -1,4 +1,18 @@
//! UUID parameter and form value parsing support.
//!
//! See the [`Uuid`](uuid::Uuid) type for further details.
//!
//! # Enabling
//!
//! This module is only available when the `uuid` feature is enabled. Enable it
//! in `Cargo.toml` as follows:
//!
//! ```toml
//! [dependencies.rocket_contrib]
//! version = "0.4.0"
//! default-features = false
//! features = ["uuid"]
//! ```
pub extern crate uuid as uuid_crate;

View File

@ -75,12 +75,16 @@ use uri::{self, UriPart, UriDisplay};
/// `u32`, `u64`, `u128`, `usize`, `f32`, `f64`, `bool`, `IpAddr`,
/// `Ipv4Addr`, `Ipv6Addr`, `&str`, `&RawStr`, `Cow<str>`
///
/// The following conversions are implemented:
/// The following conversions are implemented, allowing a value of the type on
/// the left to be used when a type on the right is expected by a route:
///
/// * `&str` to `String`
/// * `&str` to `RawStr`
/// * `String` to `&str`
/// * `String` to `RawStr`
/// * `T` to `Option<T>`
/// * `T` to `Result<T, E>`
/// * `T` to `Form<T>`
///
/// The following types have _identity_ implementations _only in [`Path`]_:
///
@ -225,7 +229,7 @@ macro_rules! impl_conversion_ref {
);
}
/// Macro to automatically generated _identity_ [`FromUriParam`] trait
/// Macro to automatically generate _identity_ [`FromUriParam`] trait
/// implementations.
///
/// For a type `T`, the _identity_ implementations of `FromUriParam` are: