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