pub struct WasmResource<'c> { /* private fields */ }Expand description
client.wasm() — B-110 sandboxed WASM module registry.
Upload WebAssembly modules that the streaming wasm operator runs over
events, sandboxed in pure-Java Chicory on the engine (no host syscalls,
bounded linear memory). Modules are org-scoped; upload / delete require the
ADMIN role.
§Example
use pulse_client::{PulseClient, WasmUpload};
client
.wasm()
.upload(WasmUpload::from_path("pii-redactor", "./redactor.wasm"))
.await?;Implementations§
Source§impl WasmResource<'_>
impl WasmResource<'_>
Sourcepub async fn upload(&self, upload: WasmUpload) -> Result<Value, PulseError>
pub async fn upload(&self, upload: WasmUpload) -> Result<Value, PulseError>
POST /api/pulse/wasm-modules — upload (or replace) a module.
Sent as multipart/form-data: a file part named module carrying the
bytes, plus a text part name and (when set) description. The module
is validated server-side (must parse, import no host functions, export
alloc/process/memory) before persisting. Replacing an existing name
hot-swaps the module with no agent restart.
Returns the persisted module metadata (name, sha256, version, …).
§Errors
PulseError::InvalidConfigifnameis blank, if neither or both ofpath/dataare set, or if the module bytes are empty.PulseError::Transportif reading the file atpathfails.
Sourcepub async fn list(&self) -> Result<Vec<Value>, PulseError>
pub async fn list(&self) -> Result<Vec<Value>, PulseError>
GET /api/pulse/wasm-modules — modules registered for the caller’s org.