Loading codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt +16 −1 Original line number Diff line number Diff line Loading @@ -279,7 +279,7 @@ class ServerServiceGeneratorV2( rustTemplate( """ ##[derive(Clone)] pub struct $serviceName<S> { pub struct $serviceName<S = #{SmithyHttpServer}::routing::Route> { router: #{SmithyHttpServer}::routers::RoutingService<#{Router}<S>, #{Protocol}>, } Loading Loading @@ -321,6 +321,21 @@ class ServerServiceGeneratorV2( router: self.router.map(|s| s.layer(layer)) } } /// Applies [`Route::new`](#{SmithyHttpServer}::routing::Route::new) to all routes. /// /// This has the effect of erasing all types accumulated via [`layer`]. pub fn boxed<B>(self) -> $serviceName<#{SmithyHttpServer}::routing::Route<B>> where S: #{Tower}::Service< #{Http}::Request<B>, Response = #{Http}::Response<#{SmithyHttpServer}::body::BoxBody>, Error = std::convert::Infallible>, S: Clone + Send + 'static, S::Future: Send + 'static, { self.layer(&#{Tower}::layer::layer_fn(#{SmithyHttpServer}::routing::Route::new)) } } impl<B, RespB, S> #{Tower}::Service<#{Http}::Request<B>> for $serviceName<S> Loading Loading
codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt +16 −1 Original line number Diff line number Diff line Loading @@ -279,7 +279,7 @@ class ServerServiceGeneratorV2( rustTemplate( """ ##[derive(Clone)] pub struct $serviceName<S> { pub struct $serviceName<S = #{SmithyHttpServer}::routing::Route> { router: #{SmithyHttpServer}::routers::RoutingService<#{Router}<S>, #{Protocol}>, } Loading Loading @@ -321,6 +321,21 @@ class ServerServiceGeneratorV2( router: self.router.map(|s| s.layer(layer)) } } /// Applies [`Route::new`](#{SmithyHttpServer}::routing::Route::new) to all routes. /// /// This has the effect of erasing all types accumulated via [`layer`]. pub fn boxed<B>(self) -> $serviceName<#{SmithyHttpServer}::routing::Route<B>> where S: #{Tower}::Service< #{Http}::Request<B>, Response = #{Http}::Response<#{SmithyHttpServer}::body::BoxBody>, Error = std::convert::Infallible>, S: Clone + Send + 'static, S::Future: Send + 'static, { self.layer(&#{Tower}::layer::layer_fn(#{SmithyHttpServer}::routing::Route::new)) } } impl<B, RespB, S> #{Tower}::Service<#{Http}::Request<B>> for $serviceName<S> Loading