pub struct WasmModule { /* private fields */ }Expand description
A Proxy-Wasm plugin exposed as a WafModule. Build with WasmModule::from_bytes.
Implementations§
Source§impl WasmModule
impl WasmModule
Sourcepub fn from_bytes(
name: &str,
wasm: &[u8],
config: &[u8],
opts: &WasmOptions,
) -> Result<(WasmModule, ImportReport), WasmError>
pub fn from_bytes( name: &str, wasm: &[u8], config: &[u8], opts: &WasmOptions, ) -> Result<(WasmModule, ImportReport), WasmError>
Compile wasm, build a pool of opts.pool_size instances, run each guest’s VM
start/configure with config, and return the module plus its import report.
Trait Implementations§
Source§impl WafModule for WasmModule
impl WafModule for WasmModule
Source§fn structural(&self) -> bool
fn structural(&self) -> bool
CRS-like: the host cannot prove a WASM plugin inert, so it runs on every request.
fn id(&self) -> &str
fn phase(&self) -> Phase
Source§fn init(&mut self, _cfg: &Config)
fn init(&mut self, _cfg: &Config)
Called once at startup; compile/init rules here, never in
inspect.Source§fn inspect(&self, ctx: &RequestContext) -> Decision
fn inspect(&self, ctx: &RequestContext) -> Decision
Read-only access to context; pipeline owns mutation of
score.Auto Trait Implementations§
impl Freeze for WasmModule
impl RefUnwindSafe for WasmModule
impl Send for WasmModule
impl Sync for WasmModule
impl Unpin for WasmModule
impl UnsafeUnpin for WasmModule
impl UnwindSafe for WasmModule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more