Loading rust-runtime/aws-smithy-http-server/src/lib.rs +2 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ pub mod rejection; pub use self::body::{Body, BoxBody, HttpBody}; #[doc(inline)] pub use self::error::Error; #[doc(inline)] pub use self::routing::Router; /// Alias for a type-erased error type. pub type BoxError = Box<dyn std::error::Error + Send + Sync>; Loading rust-runtime/aws-smithy-http-server/src/routing/future.rs +0 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ */ //! Future types. use crate::body::BoxBody; use futures_util::future::Either; use http::{Request, Response}; Loading rust-runtime/aws-smithy-http-server/src/routing/mod.rs +4 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ mod route; pub use self::{into_make_service::IntoMakeService, route::Route}; /// The router type for composing handlers and services. #[derive(Debug)] pub struct Router<B = Body> { routes: Vec<(Route<B>, RequestSpec)>, Loading Loading @@ -63,11 +64,13 @@ where /// /// Unless you add additional routes this will respond to `404 Not Found` to /// all requests. #[doc(hidden)] pub fn new() -> Self { Self { routes: Default::default() } } /// Add a route to the router. #[doc(hidden)] pub fn route<T>(mut self, request_spec: RequestSpec, svc: T) -> Self where T: Service<Request<B>, Response = Response<BoxBody>, Error = Infallible> + Clone + Send + 'static, Loading @@ -84,6 +87,7 @@ where /// [`Server`](hyper::server::Server). /// /// [`MakeService`]: tower::make::MakeService #[doc(hidden)] pub fn into_make_service(self) -> IntoMakeService<Self> { IntoMakeService::new(self) } Loading Loading
rust-runtime/aws-smithy-http-server/src/lib.rs +2 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ pub mod rejection; pub use self::body::{Body, BoxBody, HttpBody}; #[doc(inline)] pub use self::error::Error; #[doc(inline)] pub use self::routing::Router; /// Alias for a type-erased error type. pub type BoxError = Box<dyn std::error::Error + Send + Sync>; Loading
rust-runtime/aws-smithy-http-server/src/routing/future.rs +0 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ */ //! Future types. use crate::body::BoxBody; use futures_util::future::Either; use http::{Request, Response}; Loading
rust-runtime/aws-smithy-http-server/src/routing/mod.rs +4 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ mod route; pub use self::{into_make_service::IntoMakeService, route::Route}; /// The router type for composing handlers and services. #[derive(Debug)] pub struct Router<B = Body> { routes: Vec<(Route<B>, RequestSpec)>, Loading Loading @@ -63,11 +64,13 @@ where /// /// Unless you add additional routes this will respond to `404 Not Found` to /// all requests. #[doc(hidden)] pub fn new() -> Self { Self { routes: Default::default() } } /// Add a route to the router. #[doc(hidden)] pub fn route<T>(mut self, request_spec: RequestSpec, svc: T) -> Self where T: Service<Request<B>, Response = Response<BoxBody>, Error = Infallible> + Clone + Send + 'static, Loading @@ -84,6 +87,7 @@ where /// [`Server`](hyper::server::Server). /// /// [`MakeService`]: tower::make::MakeService #[doc(hidden)] pub fn into_make_service(self) -> IntoMakeService<Self> { IntoMakeService::new(self) } Loading