Rocket/contrib/src/lib.rs

82 lines
2.4 KiB
Rust
Raw Normal View History

#![feature(macro_reexport)]
// TODO: Version URLs.
#![doc(html_root_url = "https://api.rocket.rs")]
//! 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.
//!
//! 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:
//!
//! * [json*](struct.Json.html)
2017-02-08 03:40:14 +00:00
//! * [msgpack](struct.MsgPack.html)
2016-09-22 11:24:04 +00:00
//! * [handlebars_templates](struct.Template.html)
//! * [tera_templates](struct.Template.html)
//! * [uuid](struct.Uuid.html)
//!
//! 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:
//!
//! ```toml,ignore
//! [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;
#[cfg(feature = "serde")]
extern crate serde;
#[cfg(feature = "json")]
#[cfg_attr(feature = "json", macro_reexport(json_internal))]
extern crate serde_json;
#[cfg(feature = "handlebars_templates")]
pub extern crate handlebars;
#[cfg(feature = "tera_templates")]
pub extern crate tera;
#[cfg(feature = "json")]
#[cfg_attr(feature = "json", macro_use)]
#[doc(hidden)]
pub mod json;
#[cfg(feature = "json")]
pub use json::{Json, SerdeError, JsonValue};
2017-02-08 03:40:14 +00:00
#[cfg(feature = "msgpack")]
#[doc(hidden)]
pub mod msgpack;
#[cfg(feature = "msgpack")]
pub use msgpack::{MsgPack, MsgPackError};
#[cfg(feature = "templates")]
mod templates;
2017-01-13 07:07:01 +00:00
#[cfg(feature = "templates")]
pub use templates::{Template, Engines};
2017-01-10 21:33:30 +00:00
#[cfg(feature = "uuid")]
mod uuid;
2017-01-10 21:33:30 +00:00
#[cfg(feature = "uuid")]
pub use uuid::{Uuid, UuidParseError};