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#![cfg_attr(docsrs, feature(doc_cfg))]
5
6use std::{fmt, future::Future};
11pub use tower::{self, make::Shared as SharedService, service_fn, Service};
12
13mod error;
14pub use error::*;
15mod extension;
16pub use extension::*;
17mod events;
18pub use events::*;
19mod logs;
20pub use logs::*;
21mod telemetry;
22pub use telemetry::*;
23
24pub mod requests;
26
27#[cfg(feature = "tracing")]
29#[cfg_attr(docsrs, doc(cfg(feature = "tracing")))]
30pub use lambda_runtime_api_client::tracing;
31
32pub async fn run<E>(events_processor: E) -> Result<(), Error>
34where
35 E: Service<LambdaEvent>,
36 E::Future: Future<Output = Result<(), E::Error>>,
37 E::Error: Into<Box<dyn std::error::Error + Send + Sync>> + fmt::Display + fmt::Debug,
38{
39 let ext = Extension::new().with_events_processor(events_processor);
40 ext.run().await
41}