2017-02-01 01:15:42 +00:00
|
|
|
#![feature(drop_types_in_const, macro_reexport)]
|
2017-01-12 10:52:23 +00:00
|
|
|
|
2016-09-19 23:24:01 +00:00
|
|
|
//! This crate contains officially sanctioned contributor libraries that provide
|
|
|
|
//! functionality commonly used by Rocket applications.
|
|
|
|
//!
|
|
|
|
//! These libraries are always kept in-sync with the core Rocket library. They
|
|
|
|
//! provide common, but not fundamental, abstractions to be used by Rocket
|
|
|
|
//! applications. In particular, contributor libraries typically export types
|
2017-01-10 21:33:30 +00:00
|
|
|
//! implementing a combination of the `FromRequest`, `FromParam`, and
|
|
|
|
//! `Responder` traits.
|
2016-09-19 23:24:01 +00:00
|
|
|
//!
|
|
|
|
//! Each module in this library is held behind a feature flag, with the most
|
|
|
|
//! common modules exposed by default. The present feature list is below, with
|
|
|
|
//! an asterisk next to the features that are enabled by default:
|
|
|
|
//!
|
2016-09-22 11:24:04 +00:00
|
|
|
//! * [json*](struct.JSON.html)
|
|
|
|
//! * [handlebars_templates](struct.Template.html)
|
|
|
|
//! * [tera_templates](struct.Template.html)
|
2017-01-10 21:33:30 +00:00
|
|
|
//! * [uuid](struct.UUID.html)
|
2016-09-19 23:24:01 +00:00
|
|
|
//!
|
|
|
|
//! The recommend way to include features from this crate via Cargo in your
|
|
|
|
//! project is by adding a `[dependencies.rocket_contrib]` section to your
|
|
|
|
//! `Cargo.toml` file, setting `default-features` to false, and specifying
|
|
|
|
//! features manually. For example, to use the JSON module, you would add:
|
|
|
|
//!
|
2016-10-08 02:12:58 +00:00
|
|
|
//! ```toml,ignore
|
2016-09-19 23:24:01 +00:00
|
|
|
//! [dependencies.rocket_contrib]
|
|
|
|
//! version = "*"
|
|
|
|
//! default-features = false
|
|
|
|
//! features = ["json"]
|
|
|
|
//! ```
|
|
|
|
//!
|
|
|
|
//! This crate is expected to grow with time, bringing in outside crates to be
|
|
|
|
//! officially supported by Rocket.
|
|
|
|
|
|
|
|
#[macro_use] extern crate log;
|
|
|
|
#[macro_use] extern crate rocket;
|
|
|
|
|
2016-09-22 11:12:07 +00:00
|
|
|
#[cfg_attr(feature = "lazy_static_macro", macro_use)]
|
|
|
|
#[cfg(feature = "lazy_static_macro")]
|
|
|
|
extern crate lazy_static;
|
|
|
|
|
2017-02-01 01:15:42 +00:00
|
|
|
#[cfg(feature = "serde")]
|
|
|
|
extern crate serde;
|
|
|
|
|
2016-09-19 23:24:01 +00:00
|
|
|
#[cfg(feature = "json")]
|
2017-02-01 01:15:42 +00:00
|
|
|
#[cfg_attr(feature = "json", macro_reexport(json_internal))]
|
|
|
|
extern crate serde_json;
|
|
|
|
|
|
|
|
#[cfg(feature = "json")]
|
|
|
|
#[cfg_attr(feature = "json", macro_use)]
|
2016-12-29 03:01:16 +00:00
|
|
|
#[doc(hidden)]
|
|
|
|
pub mod json;
|
2016-09-19 23:24:01 +00:00
|
|
|
|
2016-12-29 03:01:16 +00:00
|
|
|
#[cfg(feature = "json")]
|
2017-02-01 01:15:42 +00:00
|
|
|
pub use json::{JSON, SerdeError, Value};
|
2016-09-22 11:12:07 +00:00
|
|
|
|
2017-02-01 01:15:42 +00:00
|
|
|
#[cfg(feature = "templates")]
|
|
|
|
mod templates;
|
2017-01-13 07:07:01 +00:00
|
|
|
|
2016-09-22 11:12:07 +00:00
|
|
|
#[cfg(feature = "templates")]
|
|
|
|
pub use templates::Template;
|
2017-01-10 21:33:30 +00:00
|
|
|
|
2017-02-01 01:15:42 +00:00
|
|
|
#[cfg(feature = "uuid")]
|
|
|
|
mod uuid;
|
|
|
|
|
2017-01-10 21:33:30 +00:00
|
|
|
#[cfg(feature = "uuid")]
|
|
|
|
pub use uuid::{UUID, UuidParseError};
|