Rocket/core/http/src/lib.rs

64 lines
1.5 KiB
Rust
Raw Normal View History

#![feature(specialization)]
#![feature(proc_macro)]
#![feature(proc_macro_non_items)]
#![feature(const_fn)]
#![recursion_limit="256"]
2016-12-20 03:50:27 +00:00
//! Types that map to concepts in HTTP.
2016-10-18 02:29:58 +00:00
//!
//! This module exports types that map to HTTP concepts or to the underlying
//! HTTP library when needed. Because the underlying HTTP library is likely to
//! change (see <a
2016-12-20 03:50:27 +00:00
//! href="https://github.com/SergioBenitez/Rocket/issues/17">#17</a>), types in
//! [hyper](hyper/index.html) should be considered unstable.
#[macro_use]
extern crate pear;
extern crate smallvec;
#[macro_use]
extern crate percent_encoding;
extern crate cookie;
extern crate time;
extern crate indexmap;
pub mod hyper;
2016-10-04 00:25:27 +00:00
pub mod uri;
#[cfg(feature = "tls")]
pub mod tls;
#[macro_use]
mod docify;
#[macro_use]
mod known_media_types;
mod cookies;
mod method;
mod media_type;
mod content_type;
mod status;
mod header;
2017-03-27 08:53:45 +00:00
mod accept;
2017-03-31 00:52:02 +00:00
mod raw_str;
mod ext;
pub(crate) mod parse;
2017-03-27 08:53:45 +00:00
// We need to export these for codegen, but otherwise it's unnecessary.
// TODO: Expose a `const fn` from ContentType when possible. (see RFC#1817)
pub mod uncased;
2018-06-04 16:06:08 +00:00
#[doc(hidden)] pub use self::parse::Indexed;
#[doc(hidden)] pub use self::media_type::{MediaParams, Source};
pub use self::method::Method;
pub use self::content_type::ContentType;
pub use self::accept::{Accept, QMediaType};
2016-12-20 03:46:49 +00:00
pub use self::status::{Status, StatusClass};
pub use self::header::{Header, HeaderMap};
2017-03-31 00:52:02 +00:00
pub use self::raw_str::RawStr;
2016-10-18 02:29:58 +00:00
pub use self::media_type::MediaType;
Remove Session in favor of private cookies. New testing API. Sessions -------- This commit removes the `Session` type in favor of methods on the `Cookies` types that allow for adding, removing, and getting private (signed and encrypted) cookies. These methods provide a superset of the functionality of `Session` while also being a minimal addition to the existing API. They can be used to implement the previous `Session` type as well as other forms of session storage. The new methods are: * Cookie::add_private(&mut self, Cookie) * Cookie::remove_private(&mut self, Cookie) * Cookie::get_private(&self, &str) Resolves #20 Testing ------- This commit removes the `rocket::testing` module. It adds the `rocket::local` module which provides a `Client` type for local dispatching of requests against a `Rocket` instance. This `local` package subsumes the previous `testing` package. Rocket Examples --------------- The `forms`, `optional_result`, and `hello_alt_methods` examples have been removed. The following example have been renamed: * extended_validation -> form_validation * hello_ranks -> ranking * from_request -> request_guard * hello_tls -> tls Other Changes ------------- This commit also includes the following smaller changes: * Config::{development, staging, production} constructors have been added for easier creation of default `Config` structures. * The `Config` type is exported from the root. * `Request` implements `Clone` and `Debug`. * `Request::new` is no longer exported. * A `Response::body_bytes` method was added to easily retrieve a response's body as a `Vec<u8>`.
2017-06-06 20:41:04 +00:00
pub use self::cookies::{Cookie, Cookies};
#[doc(hidden)]
pub use self::cookies::{Key, CookieJar};