diff --git a/Cargo.lock b/Cargo.lock index 090961c4..b691bfcc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3005,7 +3005,7 @@ dependencies = [ [[package]] name = "volo-http" -version = "0.1.9" +version = "0.1.11" dependencies = [ "bytes", "cookie", diff --git a/volo-http/Cargo.toml b/volo-http/Cargo.toml index 8450ba3b..fa8f8a1a 100644 --- a/volo-http/Cargo.toml +++ b/volo-http/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "volo-http" -version = "0.1.9" +version = "0.1.11" edition.workspace = true homepage.workspace = true repository.workspace = true diff --git a/volo-http/src/lib.rs b/volo-http/src/lib.rs index 13dc0c74..93ea4431 100644 --- a/volo-http/src/lib.rs +++ b/volo-http/src/lib.rs @@ -13,33 +13,38 @@ pub mod request; pub mod response; pub mod route; pub mod server; + pub(crate) mod service_fn; mod macros; -use std::convert::Infallible; +#[doc(hidden)] +pub mod prelude { + pub use bytes::Bytes; + pub use hyper::{ + self, + body::Incoming as BodyIncoming, + http::{self, HeaderMap, HeaderName, HeaderValue, Method, StatusCode, Uri, Version}, + }; + pub use volo::net::Address; -pub use bytes::Bytes; -pub use hyper::{ - self, - body::Incoming as BodyIncoming, - http::{self, HeaderMap, HeaderName, HeaderValue, Method, StatusCode, Uri, Version}, -}; -pub use volo::net::Address; + #[cfg(feature = "cookie")] + pub use crate::cookie::CookieJar; + #[cfg(any(feature = "serde_json", feature = "sonic_json"))] + pub use crate::json::Json; + pub use crate::{ + context::{ConnectionInfo, HttpContext}, + extension::Extension, + extract::{Form, MaybeInvalid, Query, State}, + param::Params, + request::Request, + response::Response, + route::Router, + server::Server, + }; -#[cfg(feature = "cookie")] -pub use crate::cookie::CookieJar; -#[cfg(any(feature = "serde_json", feature = "sonic_json"))] -pub use crate::json::Json; -pub use crate::{ - context::{ConnectionInfo, HttpContext}, - extension::Extension, - extract::{Form, MaybeInvalid, Query, State}, - param::Params, - request::Request, - response::Response, - route::Router, - server::Server, -}; + pub type DynService = + motore::BoxCloneService; +} -pub type DynService = motore::BoxCloneService; +pub use prelude::*;