macro_rules! simple {
(|$a:pat_param, $b:pat_param, $c:pat_param, $d:pat_param| { $($bl:tt)* }) => { ... };
}
Expand description
A macro to make writing lambda endpoints easier.
It wraps the lambda body in a Future
and a DroughtResult::Handle
, with the return as the response body.
Examples
use drought::{simple, DroughterBuilder, DroughtResult};
let simple_dir = DroughterBuilder::new()
.build_with_lambda(simple!(|_, path, _, _| {
"Welcome to a simple lambda handler!".into()
}));