Expand description
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.
Re-exports§
pub use diagnostic::Diagnostic;pub use tower;
Modules§
- diagnostic
- Diagnostic utilities to convert Rust types into Lambda Error types.
- layers
- Tower middleware to be applied to runtime invocations.
- streaming
- Utilities for Lambda Streaming functions.
- tracing
tracing - Utilities to initialize and use
tracingandtracing-subscriberin Lambda Functions. This module provides primitives to work withtracingandtracing-subscriberin Lambda functions.
Structs§
- Config
- Configuration derived from environment variables.
- Context
- 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.
- Lambda
Event - Incoming Lambda request containing the event payload and context.
- Lambda
Invocation - A simple container that provides information about a single invocation of a Lambda function.
- Metadata
Prelude - Metadata prelude for a stream response.
- Runtime
- Lambda runtime executing a handler function on incoming requests.
- Stream
Response - A streaming response that contains the metadata prelude and the stream of bytes that will be sent to the client.
Enums§
- Function
Response - An enum representing the response of a function that can return either a buffered
response of type
Bor a streaming response of typeS.
Traits§
- Into
Function Response - 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. - Service
- An asynchronous function from a
Requestto aResponse.
Functions§
- handler_
fn Deprecated - Return a new
ServiceFnwith a closure that takes an event and context as separate arguments. - run
- Starts the Lambda Rust runtime and begins polling for events on the Lambda Runtime APIs.
- service_
fn - Returns a new
ServiceFnwith the given closure. - spawn_
graceful_ shutdown_ handler Unix and graceful-shutdown - Spawns a task that will be execute a provided async closure when the process
receives unix graceful shutdown signals. If the closure takes longer than 500ms
to execute, an unhandled
SIGKILLsignal might be received.
Type Aliases§
- Error
- Error type that lambdas may result in