diff --git a/src/lib.rs b/src/lib.rs index 2c4f33fd..f7966e5d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -152,11 +152,19 @@ pub use status::Status; pub use status_code::StatusCode; pub use version::Version; +#[doc(inline)] +pub use transfer::trailers::Trailers; + +#[doc(inline)] +pub use mime::Mime; + +#[doc(inline)] +pub use headers::Headers; + #[doc(inline)] pub use crate::url::Url; pub mod security; -pub mod trailers; #[cfg(feature = "hyperium_http")] mod hyperium_http; diff --git a/src/request.rs b/src/request.rs index e10ed479..0f87cf9d 100644 --- a/src/request.rs +++ b/src/request.rs @@ -12,7 +12,7 @@ use crate::headers::{ CONTENT_TYPE, }; use crate::mime::Mime; -use crate::trailers::{self, Trailers}; +use crate::transfer::{trailers, Trailers}; use crate::{Body, Extensions, Method, StatusCode, Url, Version}; pin_project_lite::pin_project! { diff --git a/src/response.rs b/src/response.rs index 64d4312b..19a6b11c 100644 --- a/src/response.rs +++ b/src/response.rs @@ -13,7 +13,7 @@ use crate::headers::{ CONTENT_TYPE, }; use crate::mime::Mime; -use crate::trailers::{self, Trailers}; +use crate::transfer::{trailers, Trailers}; use crate::upgrade; use crate::{Body, Extensions, StatusCode, Version}; diff --git a/src/transfer/mod.rs b/src/transfer/mod.rs index 38cc6753..7ba59164 100644 --- a/src/transfer/mod.rs +++ b/src/transfer/mod.rs @@ -5,9 +5,11 @@ mod encoding; mod encoding_proposal; mod te; +pub mod trailers; mod transfer_encoding; pub use encoding::Encoding; pub use encoding_proposal::EncodingProposal; pub use te::TE; +pub use trailers::Trailers; pub use transfer_encoding::TransferEncoding; diff --git a/src/trailers.rs b/src/transfer/trailers.rs similarity index 98% rename from src/trailers.rs rename to src/transfer/trailers.rs index d77daf4e..220fb620 100644 --- a/src/trailers.rs +++ b/src/transfer/trailers.rs @@ -23,7 +23,7 @@ //! # async_std::task::block_on(async { //! # //! use http_types::{Url, Method, Request}; -//! use http_types::trailers::Trailers; +//! use http_types::transfer::Trailers; //! use http_types::headers::{HeaderName, HeaderValue}; //! use async_std::task; //! use std::str::FromStr; @@ -80,7 +80,7 @@ impl Trailers { /// ``` /// # fn main() -> Result<(), Box> { /// # - /// use http_types::trailers::Trailers; + /// use http_types::transfer::Trailers; /// /// let mut trailers = Trailers::new(); /// trailers.insert("Content-Type", "text/plain"); @@ -105,7 +105,7 @@ impl Trailers { /// ``` /// # fn main() -> Result<(), Box> { /// # - /// use http_types::trailers::Trailers; + /// use http_types::transfer::Trailers; /// /// let mut trailers = Trailers::new(); /// trailers.append("Content-Type", "text/plain");