ic-edge-workers は v1 preview の Rust library workspace。crate semver は 0.2.0。
ic-edge-web: runtime-neutralRequest/Response/Headers/Body/ limits。ic-edge-runtime: QuickJS runtime traits and host/canister runtime implementations。ic-edge-canister: IC HTTP bridge and HTTPS outcall adapter。ic-edge-store: memory and stable-memory stores for bundles and runtime KV。ic-edge-loader: bundle manifest type。ic-edge-pack: pack/upload library plusic-edgeCLI binary。
use ic_edge_runtime::{EdgeRuntime, QuickJsRuntime};
use ic_edge_web::{Body, Headers, Request};
let mut runtime = QuickJsRuntime::new()?;
runtime.eval_module(
"app",
"globalThis.__ic_edge_app = { fetch: async () => new Response('ok') }",
)?;
let response = runtime.call_app_fetch(Request::new(
"GET".to_string(),
"/".to_string(),
Headers::new(),
Body::empty(),
))?;
assert_eq!(response.body.text()?, "ok");
# Ok::<(), ic_edge_web::Error>(())Use ic-edge-canister inside a canister template to convert CDK HTTP DTOs into runtime requests.
use ic_edge_canister::{handle_cdk_http_async, CdkHttpRequest, CdkHttpResponse};
use ic_edge_runtime::AsyncEdgeRuntime;
async fn handle<R: AsyncEdgeRuntime>(
runtime: &mut R,
request: CdkHttpRequest,
) -> ic_edge_web::Result<CdkHttpResponse> {
handle_cdk_http_async(runtime, request).await
}ic-edge-runtime/default: host runtime on non-wasm targets.ic-edge-runtime/quickjs-ic: enables the wasm QuickJS backend forwasm32 + quickjs-iccanister builds.ic-edge-canister-template/quickjs-ic: forwards toic-edge-runtime/quickjs-ic.
Host builds do not need quickjs-ic. Canister release builds use:
cargo build --target wasm32-wasip1 -p ic-edge-canister-template --release --features quickjs-ic- Rust crate semver remains
0.xuntil the runtime contract is stable enough for1.0.0. v1 previewnames the product/API contract, not a crate major version.- Breaking public API changes must update
docs/public-api-contract.md,docs/runtime-api.md,docs/compatibility.md, anddocs/release-audit.json. - Additive changes require focused tests and docs in the same change.
- MSRV: Rust
1.85. - Required target:
wasm32-wasip1. - Node.js 20+ for example bundle builds.
wasi2ic,ic-wasm, andwabt/wasm-objdumpfor canister build audits.quickjs-wasm-sysfetches a WASI SDK on first build unlessQUICKJS_WASM_SYS_WASI_SDK_PATHpoints at a local SDK. Pin that path in offline or hermetic CI.
Run:
scripts/package_crates.shThe script runs tests, docs, verified cargo package for dependency-free crates, and package file-list checks for crates whose workspace dependencies are not yet on crates.io. On first release it runs cargo publish --dry-run for dependency-free crates only, because crates.io rejects package and publish verification for crates that depend on unpublished workspace crates. After ic-edge-web, ic-edge-loader, and ic-edge-store exist on crates.io, run:
IC_EDGE_FULL_PUBLISH_DRY_RUN=1 scripts/package_crates.sh