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")]
29pub use lambda_runtime_api_client::tracing;
30
31pub async fn run<E>(events_processor: E) -> Result<(), Error>
33where
34 E: Service<LambdaEvent>,
35 E::Future: Future<Output = Result<(), E::Error>>,
36 E::Error: Into<Box<dyn std::error::Error + Send + Sync>> + fmt::Display + fmt::Debug,
37{
38 let ext = Extension::new().with_events_processor(events_processor);
39 ext.run().await
40}