wasm-runner-sdk 0.1.0

High-level SDK for building WASM modules for wasm-runner
Documentation
  • Coverage
  • 63.24%
    172 out of 272 items documented0 out of 145 items with examples
  • Size
  • Source code size: 87.02 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 19.58 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 29s Average build duration of successful builds.
  • all releases: 29s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • floriank

wasm-runner-sdk

High-level Rust SDK for building WASM modules that run on wasm-runner.

Note: This crate is highly experimental and the APIs may change without notice.

Usage

Add the dependency:

[dependencies]
wasm-runner-sdk = "0.1.0"

Create a module:

use wasm_runner_sdk::prelude::*;

fn hello() -> Json<serde_json::Value> {
    Json(serde_json::json!({ "message": "Hello from wasm-runner!" }))
}

#[unsafe(no_mangle)]
pub extern "C" fn _start() {
    Router::new().get("/", hello).run();
}

Capabilities

Capabilities are configured in deployment.json. You can check them at runtime:

use wasm_runner_sdk::prelude::*;

if capabilities::has(Capability::Network) {
    let client = Client::new();
    let _ = client.get("https://example.com").send();
}