Vicuna
AWS Lambdas in Rust made simple.
- Simple, middleware-based interface
- Naturally modular design
- Purpose-built for
serverless-rust
📦 Install
Add the following to your Cargo.toml
file.
[]
= "0.1.0"
🤸 Usage
💡 This crate is intended to be paired with the
serverless-rust
plugin.
Vicuna produces handlers which take in a Lambda request and produce an
appropriate response. The simplest handler is the default_handler
provided by
the crate:
use lambda;
use default_handler;
Handlers can be composed from middleware which can handle the request-response lifecycle in an arbitrary fashion. For example, a middleware that adds a header to our response could look like this:
use ;
use Handler;
Middleware are wrapped around handlers, which themselves produce a handler for chainable invocation:
use ;
use ;
use ;