1#![deny(clippy::all, clippy::cargo)]
2#![allow(clippy::multiple_crate_versions, clippy::type_complexity)]
3#![warn(missing_docs, nonstandard_style, rust_2018_idioms)]
4
5use std::{fmt, future::Future};
10pub use tower::{self, make::Shared as SharedService, service_fn, Service};
11
12mod error;
13pub use error::*;
14mod extension;
15pub use extension::*;
16mod events;
17pub use events::*;
18mod logs;
19pub use logs::*;
20mod telemetry;
21pub use telemetry::*;
22
23pub mod requests;
25
26#[cfg(feature = "tracing")]
28pub use lambda_runtime_api_client::tracing;
29
30pub async fn run<E>(events_processor: E) -> Result<(), Error>
32where
33 E: Service<LambdaEvent>,
34 E::Future: Future<Output = Result<(), E::Error>>,
35 E::Error: Into<Box<dyn std::error::Error + Send + Sync>> + fmt::Display + fmt::Debug,
36{
37 let ext = Extension::new().with_events_processor(events_processor);
38 ext.run().await
39}