Mikrozen
A minimal, ergonomic router and JSON response macro for #![no_std] WASI Rust plugins.
Features
#![no_std]+extern crate alloc- Simple string-based routing for WASI plugins
- Ergonomic
response!macro for JSON output - Input extraction helpers for common types
- Optional
decimalfeature forrust_decimal - Designed for Go-hosted WASI, not browsers
Example Usage
use *;
router!
// Usage:
// let input = RouterInput::new(BTreeMap::new());
// let out = Router::dispatch("hello", input);
Input Extraction
let n = args.get_i64;
let flag = args.get_bool;
let arr = args.get_array;
let obj = args.get_object;
let val = args.get_value;
Decimal Feature
Enable with --features decimal to use get_decimal:
let dec = args.get_decimal;
License
BSD 3-Clause