Expand description
Proc macros for building Barbacane WASM plugins.
This crate provides the #[barbacane_middleware] and #[barbacane_dispatcher]
attribute macros that generate the necessary WASM exports for plugin entry points.
§Example
ⓘ
use barbacane_plugin_sdk::prelude::*;
#[barbacane_middleware]
struct RateLimiter {
quota: u32,
window: u32,
}
impl RateLimiter {
fn on_request(&mut self, req: Request) -> Action<Request> {
// Rate limiting logic
Action::Continue(req)
}
fn on_response(&mut self, resp: Response) -> Response {
resp
}
}Attribute Macros§
- barbacane_
dispatcher - Generates WASM exports for a dispatcher plugin.
- barbacane_
middleware - Generates WASM exports for a middleware plugin.