pub trait Program {
// Required method
fn new(params: HashMap<String, String>) -> Self;
// Provided method
fn run(&self) -> i32 { ... }
}Expand description
Extend the ability of Easegress by implement Program trait.
Required Methods§
Sourcefn new(params: HashMap<String, String>) -> Self
fn new(params: HashMap<String, String>) -> Self
Easegress will call new when initializing the WasmHost filter. You can initialize your struct here.
The parameter is a HashMap<String, String> representing parameters field in the spec.
e.g. With this spec:
filters:
- name: wasm
kind: WasmHost
parameters:
blockRatio: "0.4"
maxPermission: "3"HashMap<String, String> contains {“blockRation”: “0.4”, “maxPermission”: “3”}.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.