Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make trailers module a submodle of transfer #309

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down
2 changes: 1 addition & 1 deletion src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
2 changes: 2 additions & 0 deletions src/transfer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
6 changes: 3 additions & 3 deletions src/trailers.rs → src/transfer/trailers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -80,7 +80,7 @@ impl Trailers {
/// ```
/// # fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
/// #
/// use http_types::trailers::Trailers;
/// use http_types::transfer::Trailers;
///
/// let mut trailers = Trailers::new();
/// trailers.insert("Content-Type", "text/plain");
Expand All @@ -105,7 +105,7 @@ impl Trailers {
/// ```
/// # fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
/// #
/// use http_types::trailers::Trailers;
/// use http_types::transfer::Trailers;
///
/// let mut trailers = Trailers::new();
/// trailers.append("Content-Type", "text/plain");
Expand Down