re-export useful http items at top level

This commit is contained in:
Rob Ede 2021-04-19 02:01:15 +01:00
parent ea5de27fa9
commit 0e86b1c512
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
3 changed files with 20 additions and 12 deletions

View File

@ -35,7 +35,7 @@ mod config;
#[cfg(feature = "compress")]
pub mod encoding;
mod extensions;
mod header;
pub mod header;
mod helpers;
mod http_message;
mod message;
@ -63,7 +63,14 @@ pub use self::request::Request;
pub use self::response::Response;
pub use self::response_builder::ResponseBuilder;
pub use self::service::HttpService;
pub use self::header::ContentEncoding;
pub use self::message::ConnectionType;
pub use ::http::{StatusCode, Version, Method};
pub use ::http::{uri, uri::Uri};
// deprecate this mish-mash of random items
#[deprecated = "Everything in this module is available elsewhere."]
pub mod http {
//! Various HTTP related types.

View File

@ -1,12 +1,15 @@
use std::cell::{Ref, RefCell, RefMut};
use std::net;
use std::rc::Rc;
use std::{
cell::{Ref, RefCell, RefMut},
net,
rc::Rc,
};
use bitflags::bitflags;
use crate::extensions::Extensions;
use crate::header::HeaderMap;
use crate::http::{header, Method, StatusCode, Uri, Version};
use crate::{
header::{self, HeaderMap},
Extensions, Method, StatusCode, Uri, Version,
};
/// Represents various types of connection
#[derive(Copy, Clone, PartialEq, Debug)]

View File

@ -14,12 +14,10 @@ use futures_core::Stream;
use crate::{
body::{Body, BodyStream, ResponseBody},
error::Error,
extensions::Extensions,
header::{IntoHeaderPair, IntoHeaderValue},
http::{header, Error as HttpError, StatusCode},
error::{Error, HttpError},
header::{self, IntoHeaderPair, IntoHeaderValue},
message::{BoxedResponseHead, ConnectionType, ResponseHead},
Response,
Extensions, Response, StatusCode,
};
/// An HTTP response builder.