Rocket/lib/src/lib.rs

60 lines
1.7 KiB
Rust
Raw Normal View History

#![feature(question_mark)]
#![feature(specialization)]
2016-09-30 04:44:27 +00:00
//! # Rocket
//!
//! Hello, and welcome to the core Rocket API documentation!
//!
//! This API documentation is highly technical and is purely a reference.
//! There's an [overview](https://rocket.rs/overview) of Rocket on the main site
//! as well as a [full, detailed guide](https://rocket.rs/guide). If you'd like
//! pointers on getting started, see the
2016-10-01 03:22:06 +00:00
//! [quickstart](https://rocket.rs/guide/quickstart) or [getting
//! started](https://rocket.rs/guide/getting_started) chapters of the guide.
2016-09-30 04:44:27 +00:00
//!
//! You may also be interested in looking at the [contrib API
//! documentation](../rocket_contrib), which contains JSON and templating
2016-09-30 04:44:27 +00:00
//! support.
extern crate term_painter;
extern crate hyper;
extern crate url;
extern crate mime;
#[macro_use] extern crate log;
#[doc(hidden)] #[macro_use] pub mod logger;
#[doc(hidden)] pub mod content_type;
pub mod form;
pub mod request;
pub mod response;
mod method;
mod error;
mod router;
mod rocket;
mod codegen;
mod catcher;
/// Defines the types for request and error handlers.
pub mod handler {
use super::{Request, Response, Error};
/// The type of a request handler.
pub type Handler = for<'r> fn(&'r Request<'r>) -> Response<'r>;
/// The type of an error handler.
pub type ErrorHandler = for<'r> fn(error: Error, &'r Request<'r>) -> Response<'r>;
}
#[doc(inline)] pub use response::{Response, Responder};
#[doc(inline)] pub use handler::{Handler, ErrorHandler};
#[doc(inline)] pub use logger::LoggingLevel;
pub use content_type::ContentType;
pub use codegen::{StaticRouteInfo, StaticCatchInfo};
pub use request::Request;
pub use method::Method;
pub use error::Error;
pub use router::{Router, Route};
pub use catcher::Catcher;
pub use rocket::Rocket;