Struct lambda_extension::Extension
source · [−]pub struct Extension<'a, E, L> { /* private fields */ }
Expand description
An Extension that runs event and log processors
Implementations
sourceimpl<'a> Extension<'a, Identity<LambdaEvent>, MakeIdentity<Vec<LambdaLog>>>
impl<'a> Extension<'a, Identity<LambdaEvent>, MakeIdentity<Vec<LambdaLog>>>
sourceimpl<'a, E, L> Extension<'a, E, L> 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,
impl<'a, E, L> Extension<'a, E, L> 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,
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> 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> 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> 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> 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.
Trait Implementations
Auto Trait Implementations
impl<'a, E, L> RefUnwindSafe for Extension<'a, E, L> where
E: RefUnwindSafe,
L: RefUnwindSafe,
impl<'a, E, L> Send for Extension<'a, E, L> where
E: Send,
L: Send,
impl<'a, E, L> Sync for Extension<'a, E, L> where
E: Sync,
L: Sync,
impl<'a, E, L> Unpin for Extension<'a, E, L> where
E: Unpin,
L: Unpin,
impl<'a, E, L> UnwindSafe for Extension<'a, E, L> where
E: UnwindSafe,
L: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more