pub trait RequestHandler: Send + Sync {
// Required method
fn handle<'life0, 'async_trait>(
&'life0 self,
request: LambdaRequest,
) -> Pin<Box<dyn Future<Output = LambdaResponse> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
The contract LambdaRuntime drives.
Implemented here for any Fn(LambdaRequest) -> Future<Output = LambdaResponse>.
Other types implement it themselves, or via impl_lambda_handler!; there
is no blanket implementation for an Armature Application.
Required Methods§
Sourcefn handle<'life0, 'async_trait>(
&'life0 self,
request: LambdaRequest,
) -> Pin<Box<dyn Future<Output = LambdaResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
request: LambdaRequest,
) -> Pin<Box<dyn Future<Output = LambdaResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle an HTTP request.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<F, Fut> RequestHandler for F
Example implementation for a simple handler function.