pub trait Handler: Sized {
type Error;
type Response: IntoResponse;
type Fut: Future<Output = Result<Self::Response, Self::Error>> + 'static;
// Required method
fn call(&mut self, event: Request, context: Context) -> Self::Fut;
}Expand description
Functions serving as ALB and API Gateway REST and HTTP API handlers must conform to this type.
This can be viewed as a lambda::Handler constrained to http crate Request and Response types
Required Associated Types§
Sourcetype Response: IntoResponse
type Response: IntoResponse
The type of Response this Handler will return
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.