molt-registry-client 0.0.43

Molt WASM-aware registry client built on oci-client (OCI /v2 + /wasm/v1)
Documentation

Molt WASM-aware registry client.

This crate is a thin, WASM-focused extension on top of [oci-client] (oras-project/rust-oci-client).

It supports:

  • OCI Distribution API (/v2) helpers for pulling component wasm layers.
  • Molt extension API (/wasm/v1) helpers for WIT, interface index, and search.

The Molt spec this targets is described in this repo's docs:

  • WIT referrers: application/vnd.wasm.wit.v1+text
  • /wasm/v1 endpoints: .../wit, .../interfaces, .../dependencies, /search

Example (env-configured)

use molt_registry_client::{OciWasmClient, WasmV1Client, WitRequest};

# async fn run() -> anyhow::Result<()> {
let oci = OciWasmClient::from_env()?.expect("set MOLT_REGISTRY");
let wasm = oci.pull_component_wasm("example/repo", "1.0.0").await?;
println!("downloaded {} bytes", wasm.len());

let wasm_v1 = WasmV1Client::from_env()?.expect("set MOLT_REGISTRY");
let wit = wasm_v1
    .wit_text("example/repo", "1.0.0", &WitRequest::default())
    .await?;
println!("{}", wit.text);

# Ok(()) }