MCPcopy Index your code
hub / github.com/aws/aws-lambda-rust-runtime / main

Function main

examples/basic-lambda/src/main.rs:26–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24
25#[tokio::main]
26async fn main() -> Result<(), Error> {
27 // required to enable CloudWatch error logging by the runtime
28 tracing::init_default_subscriber();
29
30 let func = service_fn(my_handler);
31 if let Err(err) = lambda_runtime::run(func).await {
32 eprintln!("run error: {:?}", err);
33 return Err(err);
34 }
35 Ok(())
36}
37
38pub(crate) async fn my_handler(event: LambdaEvent<Request>) -> Result<Response, Error> {
39 // extract some useful info from the request

Callers

nothing calls this directly

Calls 2

init_default_subscriberFunction · 0.85
runFunction · 0.50

Tested by

no test coverage detected