You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-8
Original file line number
Diff line number
Diff line change
@@ -15,17 +15,18 @@ This package makes it easy to run AWS Lambda Functions written in Rust. This wor
15
15
The code below creates a simple function that receives an event with a `firstName` field and returns a message to the caller. Notice: this crate is tested against latest stable Rust.
16
16
17
17
```rust,no_run
18
-
use lambda_runtime::{handler_fn, Context, Error};
18
+
use lambda_runtime::{service_fn, LambdaEvent, Error};
@@ -213,12 +214,9 @@ Lambdas can be run and debugged locally using a special [Lambda debug proxy](htt
213
214
214
215
## `lambda`
215
216
216
-
`lambda_runtime` is a library for authoring reliable and performant Rust-based AWS Lambda functions. At a high level, it provides a few major components:
217
+
`lambda_runtime` is a library for authoring reliable and performant Rust-based AWS Lambda functions. At a high level, it provides `lambda_runtime::run`, a function that runs a `tower::Service<LambdaEvent>`.
217
218
218
-
-`Handler`, a trait that defines interactions between customer-authored code and this library.
219
-
-`lambda_runtime::run`, function that runs an `Handler`.
220
-
221
-
The function `handler_fn` converts a rust function or closure to `Handler`, which can then be run by `lambda_runtime::run`.
219
+
To write a function that will handle request, you need to pass it through `service_fn`, which will convert your function into a `tower::Service<LambdaEvent>`, which can then be run by `lambda_runtime::run`.
0 commit comments