Struct lambda_extension::Extension
source · pub struct Extension<'a, E, L, T> { /* private fields */ }
Expand description
An Extension that runs event, log and telemetry processors
Implementations§
source§impl<'a> Extension<'a, Identity<LambdaEvent>, MakeIdentity<Vec<LambdaLog>>, MakeIdentity<Vec<LambdaTelemetry>>>
impl<'a> Extension<'a, Identity<LambdaEvent>, MakeIdentity<Vec<LambdaLog>>, MakeIdentity<Vec<LambdaTelemetry>>>
source§impl<'a, E, L, T> Extension<'a, E, L, T>where
E: Service<LambdaEvent>,
E::Future: Future<Output = Result<(), E::Error>>,
E::Error: Into<Box<dyn Error + Send + Sync>> + Display + Debug,
L: MakeService<(), Vec<LambdaLog>, Response = ()> + Send + Sync + 'static,
L::Service: Service<Vec<LambdaLog>, Response = ()> + Send + Sync,
<L::Service as Service<Vec<LambdaLog>>>::Future: Send + 'a,
L::Error: Into<Box<dyn Error + Send + Sync>> + Debug,
L::MakeError: Into<Box<dyn Error + Send + Sync>> + Debug,
L::Future: Send,
T: MakeService<(), Vec<LambdaTelemetry>, Response = ()> + Send + Sync + 'static,
T::Service: Service<Vec<LambdaTelemetry>, Response = ()> + Send + Sync,
<T::Service as Service<Vec<LambdaTelemetry>>>::Future: Send + 'a,
T::Error: Into<Box<dyn Error + Send + Sync>> + Debug,
T::MakeError: Into<Box<dyn Error + Send + Sync>> + Debug,
T::Future: Send,
impl<'a, E, L, T> Extension<'a, E, L, T>where E: Service<LambdaEvent>, E::Future: Future<Output = Result<(), E::Error>>, E::Error: Into<Box<dyn Error + Send + Sync>> + Display + Debug, L: MakeService<(), Vec<LambdaLog>, Response = ()> + Send + Sync + 'static, L::Service: Service<Vec<LambdaLog>, Response = ()> + Send + Sync, <L::Service as Service<Vec<LambdaLog>>>::Future: Send + 'a, L::Error: Into<Box<dyn Error + Send + Sync>> + Debug, L::MakeError: Into<Box<dyn Error + Send + Sync>> + Debug, L::Future: Send, T: MakeService<(), Vec<LambdaTelemetry>, Response = ()> + Send + Sync + 'static, T::Service: Service<Vec<LambdaTelemetry>, Response = ()> + Send + Sync, <T::Service as Service<Vec<LambdaTelemetry>>>::Future: Send + 'a, T::Error: Into<Box<dyn Error + Send + Sync>> + Debug, T::MakeError: Into<Box<dyn Error + Send + Sync>> + Debug, T::Future: Send,
sourcepub fn with_extension_name(self, extension_name: &'a str) -> Self
pub fn with_extension_name(self, extension_name: &'a str) -> Self
Create a new Extension
with a given extension name
sourcepub fn with_events(self, events: &'a [&'a str]) -> Self
pub fn with_events(self, events: &'a [&'a str]) -> Self
Create a new Extension
with a list of given events.
The only accepted events are INVOKE
and SHUTDOWN
.
sourcepub fn with_events_processor<N>(self, ep: N) -> Extension<'a, N, L, T>where
N: Service<LambdaEvent>,
N::Future: Future<Output = Result<(), N::Error>>,
N::Error: Into<Box<dyn Error + Send + Sync>> + Display,
pub fn with_events_processor<N>(self, ep: N) -> Extension<'a, N, L, T>where N: Service<LambdaEvent>, N::Future: Future<Output = Result<(), N::Error>>, N::Error: Into<Box<dyn Error + Send + Sync>> + Display,
Create a new Extension
with a service that receives Lambda events.
sourcepub fn with_logs_processor<N, NS>(self, lp: N) -> Extension<'a, E, N, T>where
N: Service<()>,
N::Future: Future<Output = Result<NS, N::Error>>,
N::Error: Into<Box<dyn Error + Send + Sync>> + Display,
pub fn with_logs_processor<N, NS>(self, lp: N) -> Extension<'a, E, N, T>where N: Service<()>, N::Future: Future<Output = Result<NS, N::Error>>, N::Error: Into<Box<dyn Error + Send + Sync>> + Display,
Create a new Extension
with a service that receives Lambda logs.
sourcepub fn with_log_types(self, log_types: &'a [&'a str]) -> Self
pub fn with_log_types(self, log_types: &'a [&'a str]) -> Self
Create a new Extension
with a list of logs types to subscribe.
The only accepted log types are function
, platform
, and extension
.
sourcepub fn with_log_buffering(self, lb: LogBuffering) -> Self
pub fn with_log_buffering(self, lb: LogBuffering) -> Self
Create a new Extension
with specific configuration to buffer logs.
sourcepub fn with_log_port_number(self, port_number: u16) -> Self
pub fn with_log_port_number(self, port_number: u16) -> Self
Create a new Extension
with a different port number to listen to logs.
sourcepub fn with_telemetry_processor<N, NS>(self, lp: N) -> Extension<'a, E, L, N>where
N: Service<()>,
N::Future: Future<Output = Result<NS, N::Error>>,
N::Error: Into<Box<dyn Error + Send + Sync>> + Display,
pub fn with_telemetry_processor<N, NS>(self, lp: N) -> Extension<'a, E, L, N>where N: Service<()>, N::Future: Future<Output = Result<NS, N::Error>>, N::Error: Into<Box<dyn Error + Send + Sync>> + Display,
Create a new Extension
with a service that receives Lambda telemetry data.
sourcepub fn with_telemetry_types(self, telemetry_types: &'a [&'a str]) -> Self
pub fn with_telemetry_types(self, telemetry_types: &'a [&'a str]) -> Self
Create a new Extension
with a list of telemetry types to subscribe.
The only accepted telemetry types are function
, platform
, and extension
.
sourcepub fn with_telemetry_buffering(self, lb: LogBuffering) -> Self
pub fn with_telemetry_buffering(self, lb: LogBuffering) -> Self
Create a new Extension
with specific configuration to buffer telemetry.
sourcepub fn with_telemetry_port_number(self, port_number: u16) -> Self
pub fn with_telemetry_port_number(self, port_number: u16) -> Self
Create a new Extension
with a different port number to listen to telemetry.