Expand description
Cha Plugin SDK — toolkit for building Cha WASM analyzer plugins.
§Usage
Cargo.toml:
[lib]
crate-type = ["cdylib"]
[dependencies]
cha-plugin-sdk = { git = "https://github.com/W-Mai/Cha" }
wit-bindgen = "0.55"src/lib.rs:
ⓘ
cha_plugin_sdk::plugin!(MyPlugin);
struct MyPlugin;
impl Guest for MyPlugin {
fn name() -> String { "my-plugin".into() }
fn analyze(input: AnalysisInput) -> Vec<Finding> { vec![] }
}Macros§
- option_
bool - Extract a boolean option by key.
- option_
float - Extract a float option by key.
- option_
int - Extract an integer option by key.
- option_
list_ str - Extract a string list option by key.
- option_
str - Extract a string option by key from
analysis-input.options. - plugin
- Set up bindings and export a plugin implementation.
- str_
options - Iterate all string options as
(key, value)pairs.