2020-10-21 11:54:24 +00:00
|
|
|
#![doc(html_root_url = "https://api.rocket.rs/master")]
|
2020-06-11 09:30:14 +00:00
|
|
|
#![doc(html_favicon_url = "https://rocket.rs/images/favicon.ico")]
|
|
|
|
#![doc(html_logo_url = "https://rocket.rs/images/logo-boxed.png")]
|
2017-06-11 08:03:59 +00:00
|
|
|
|
2019-06-13 02:17:59 +00:00
|
|
|
#![warn(rust_2018_idioms)]
|
|
|
|
#![allow(unused_extern_crates)]
|
|
|
|
|
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
|
2018-10-06 13:25:17 +00:00
|
|
|
//! applications.
|
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:
|
|
|
|
//!
|
2018-10-07 00:24:11 +00:00
|
|
|
//! * [json*](type@json) - JSON (de)serialization
|
|
|
|
//! * [serve*](serve) - Static File Serving
|
|
|
|
//! * [msgpack](msgpack) - MessagePack (de)serialization
|
|
|
|
//! * [handlebars_templates](templates) - Handlebars Templating
|
|
|
|
//! * [tera_templates](templates) - Tera Templating
|
|
|
|
//! * [uuid](uuid) - UUID (de)serialization
|
|
|
|
//! * [${database}_pool](databases) - Database Configuration and Pooling
|
2018-11-08 17:01:58 +00:00
|
|
|
//! * [helmet](helmet) - Fairing for Security and Privacy Headers
|
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:
|
|
|
|
//!
|
2018-10-06 13:25:17 +00:00
|
|
|
//! ```toml
|
2016-09-19 23:24:01 +00:00
|
|
|
//! [dependencies.rocket_contrib]
|
2019-05-13 23:18:48 +00:00
|
|
|
//! version = "0.5.0-dev"
|
2016-09-19 23:24:01 +00:00
|
|
|
//! default-features = false
|
|
|
|
//! features = ["json"]
|
|
|
|
//! ```
|
|
|
|
//!
|
|
|
|
//! This crate is expected to grow with time, bringing in outside crates to be
|
|
|
|
//! officially supported by Rocket.
|
|
|
|
|
2018-09-20 04:14:30 +00:00
|
|
|
#[allow(unused_imports)] #[macro_use] extern crate log;
|
|
|
|
#[allow(unused_imports)] #[macro_use] extern crate rocket;
|
2016-09-19 23:24:01 +00:00
|
|
|
|
2018-10-07 00:24:11 +00:00
|
|
|
#[cfg(feature="json")] #[macro_use] pub mod json;
|
|
|
|
#[cfg(feature="serve")] pub mod serve;
|
|
|
|
#[cfg(feature="msgpack")] pub mod msgpack;
|
|
|
|
#[cfg(feature="templates")] pub mod templates;
|
|
|
|
#[cfg(feature="uuid")] pub mod uuid;
|
|
|
|
#[cfg(feature="databases")] pub mod databases;
|
2018-11-08 17:01:58 +00:00
|
|
|
#[cfg(feature = "helmet")] pub mod helmet;
|
2020-02-03 08:53:59 +00:00
|
|
|
// TODO.async: Migrate compression, reenable this, tests, and add to docs.
|
2019-08-29 02:56:33 +00:00
|
|
|
//#[cfg(any(feature="brotli_compression", feature="gzip_compression"))] pub mod compression;
|
2017-02-01 01:15:42 +00:00
|
|
|
|
2018-10-09 11:16:57 +00:00
|
|
|
#[cfg(feature="databases")] #[doc(hidden)] pub use rocket_contrib_codegen::*;
|