1 unstable release
0.1.0 | Oct 16, 2024 |
---|
#530 in Asynchronous
65 downloads per month
Used in 2 crates
(via aranya-daemon)
470KB
11K
SLoC
Policy Interface Generation
Generate typed Rust interface from policy code.
Quickstart
# Cargo.toml
[dependencies]
aranya-policy-ifgen = { ... }
[build-dependencies]
aranya-policy-ifgen-build = { ... }
// build.rs
fn main() {
println!("cargo:rerun-if-changed=src/policy.md");
aranya_policy_ifgen_build::generate("src/policy.md", "src/policy.rs").unwrap();
}
// src/lib.rs
#[rustfmt::skip]
mod policy;
impl aranya_policy_ifgen::Actor for MyActor { ... }
fn do_the_thing(actor: &MyActor) -> Result<(), aranya_runtime::ClientError> {
use policy::ActorExt;
actor.some_action(42, "my string")
}
Dependencies
~18–28MB
~435K SLoC