Add prelude

This commit is contained in:
David Pedersen
2021-06-06 11:42:44 +02:00
parent 46398afc72
commit 470d6ceabd
2 changed files with 11 additions and 1 deletions
+10
View File
@@ -68,6 +68,16 @@ pub use self::{
pub use async_trait::async_trait;
pub use tower_http::add_extension::{AddExtension, AddExtensionLayer};
pub mod prelude {
pub use crate::{
body::Body,
extract,
handler::{get, on, post, Handler},
response, route,
routing::AddRoute,
};
}
pub fn route<S>(spec: &str, svc: S) -> Route<S, EmptyRouter>
where
S: Service<Request<Body>, Error = Infallible> + Clone,