The mechanism available for defining a Lambda function is as follows:
Create a type that conforms to the
tower::Service trait. This type can
then be passed to the the
lambda_runtime::run function, which launches
and runs the Lambda runtime.
pub use tower;
- Configuration derived from environment variables.
- The Lambda function execution context. The values in this struct are populated using the Lambda environment variables and the headers returned by the poll request to the Runtime APIs.
- Incoming Lambda request containing the event payload and context.
- Metadata prelude for a stream response.
- A streaming response that contains the metadata prelude and the stream of bytes that will be sent to the client.
- An enum representing the response of a function that can return either a buffered response of type
Bor a streaming response of type
- a trait that can be implemented for any type that can be converted into a FunctionResponse. This allows us to use the
intomethod to convert a type into a FunctionResponse.
- An asynchronous function from a
- handler_fnDeprecatedReturn a new
ServiceFnwith a closure that takes an event and context as separate arguments.
- Starts the Lambda Rust runtime and begins polling for events on the Lambda Runtime APIs.
- Returns a new
ServiceFnwith the given closure.
- Error type that lambdas may result in