Rocket

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit b88a2d7d0518dfda34aa50e2f92ade7a56d0e47a
parent d3c161e7d6c9249f7ffdcb230eba986f9ca1fc0e
Author: Sergio Benitez <sb@sergio.bz>
Date:   Fri,  7 Dec 2018 09:07:27 -0800

Add notes about enabling features to contrib docs.

Diffstat:
Mcontrib/lib/src/helmet/mod.rs | 12++++++++++++
Mcontrib/lib/src/json.rs | 13+++++++++++++
Mcontrib/lib/src/msgpack.rs | 12++++++++++++
Mcontrib/lib/src/serve.rs | 14++++++++++++++
Mcontrib/lib/src/uuid.rs | 14++++++++++++++
Mcore/http/src/uri/from_uri_param.rs | 8++++++--
6 files changed, 71 insertions(+), 2 deletions(-)

diff --git a/contrib/lib/src/helmet/mod.rs b/contrib/lib/src/helmet/mod.rs @@ -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? | diff --git a/contrib/lib/src/json.rs b/contrib/lib/src/json.rs @@ -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; diff --git a/contrib/lib/src/msgpack.rs b/contrib/lib/src/msgpack.rs @@ -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; diff --git a/contrib/lib/src/serve.rs b/contrib/lib/src/serve.rs @@ -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}; diff --git a/contrib/lib/src/uuid.rs b/contrib/lib/src/uuid.rs @@ -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; diff --git a/core/http/src/uri/from_uri_param.rs b/core/http/src/uri/from_uri_param.rs @@ -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: