Add a new layer to this runtime. For an incoming request, this layer will be executed before any layer that has been added prior. # Example ```no_run use lambda_runtime::{layers, Error, LambdaEvent, Runtime}; use serde_json::Value; use tower::service_fn; #[tokio::main] async fn main() -> Result<(), Error> { let runtime = Runtime::new(service_fn(echo)).layer( layers::TracingLayer::new() ); runtim
(self, layer: L)
| 148 | /// } |
| 149 | /// ``` |
| 150 | pub fn layer<L>(self, layer: L) -> Runtime<L::Service> |
| 151 | where |
| 152 | L: Layer<S>, |
| 153 | L::Service: Service<LambdaInvocation, Response = (), Error = BoxError>, |
| 154 | { |
| 155 | Runtime { |
| 156 | client: self.client, |
| 157 | config: self.config, |
| 158 | service: layer.layer(self.service), |
| 159 | concurrency_limit: self.concurrency_limit, |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | #[cfg(feature = "concurrency-tokio")] |
no outgoing calls