macro_rules! api_endpoint {
(
$path:expr_2021,
// API version this endpoint was introduced in, at the current consensus level.
$version_introduced:expr_2021,
async |$state:ident: &$state_ty:ty, $context:ident, $param:ident: $param_ty:ty| -> $resp_ty:ty $body:block
) => { ... };
}Expand description
ยงExample
struct State;
let _: ApiEndpoint<State> = api_endpoint! {
"/foobar",
ApiVersion::new(0, 3),
async |state: &State, _dbtx, params: ()| -> i32 {
Ok(0)
}
};