Skip to main content

http_core/
lib.rs

1//! Pimitive HTTP types.
2
3#![cfg_attr(docsrs, feature(doc_cfg))]
4
5pub use http_field::{Field, FieldName, FieldValue};
6pub use http_method::Method;
7pub use http_request_target::{
8    RequestTarget, RequestTargetAbsolute, RequestTargetAuthority, RequestTargetOrigin,
9};
10pub use http_status_code::StatusCode;
11pub use http_version::Version;
12
13#[cfg(test)]
14mod tests {
15    use super::*;
16
17    #[test]
18    fn re_exports_primary_types() {
19        let _ = Field::try_from_slice(b"accept: application/json").unwrap();
20        let _ = Method::try_from_slice(b"GET").unwrap();
21        let _ = RequestTarget::try_from_slice(b"/").unwrap();
22        let _ = StatusCode::from_u16(200);
23        let _ = Version::try_from_slice(b"HTTP/1.1").unwrap();
24    }
25}