rocket_http_community/lib.rs
1#![warn(rust_2018_idioms)]
2#![warn(missing_docs)]
3
4//! Types that map to concepts in HTTP.
5//!
6//! This module exports types that map to HTTP concepts or to the underlying
7//! HTTP library when needed.
8
9#[macro_use]
10extern crate pear;
11
12pub mod ext;
13pub mod uri;
14
15#[macro_use]
16mod header;
17mod method;
18mod parse;
19mod raw_str;
20mod status;
21
22/// Case-preserving, ASCII case-insensitive string types.
23///
24/// An _uncased_ string is case-preserving. That is, the string itself contains
25/// cased characters, but comparison (including ordering, equality, and hashing)
26/// is ASCII case-insensitive. **Note:** the `alloc` feature _is_ enabled.
27pub mod uncased {
28 #[doc(inline)]
29 pub use uncased::*;
30}
31
32// Types that we expose for use _only_ by core. Please don't use this.
33#[doc(hidden)]
34#[path = "."]
35pub mod private {
36 pub use crate::parse::Indexed;
37}
38
39pub use crate::header::*;
40pub use crate::method::Method;
41pub use crate::raw_str::{RawStr, RawStrBuf};
42pub use crate::status::{Status, StatusClass};
43
44/// HTTP Protocol version
45#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
46#[non_exhaustive]
47pub enum HttpVersion {
48 /// `HTTP/0.9`
49 Http09,
50 /// `HTTP/1.0`
51 Http10,
52 /// `HTTP/1.1`
53 Http11,
54 /// `HTTP/2`
55 Http2,
56 /// `HTTP/3`
57 Http3,
58}