Expand description
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/v1endpoints:.../wit,.../interfaces,.../dependencies,/search
§Example (env-configured)
use molt_registry_client::{OciWasmClient, WasmV1Client, WitRequest};
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);
Structs§
- Interfaces
Response - OciWasm
Client - Pulled
Component Wasm - Push
WitResult - Referrer
Descriptor - Registry
Endpoint - Search
Query - Search
Response - Search
Result - Wasm
V1Client - WitRequest
- WitText
Response
Constants§
- OCI_
EMPTY_ CONFIG_ MEDIA_ TYPE - Recommended media type for empty
{}config blobs for artifact manifests. - OCI_
IMAGE_ MANIFEST_ MEDIA_ TYPE - OCI image manifest media type (required for WIT referrers).
- WASM_
COMPONENT_ ARTIFACT_ TYPE - Component artifactType (recommended).
- WASM_
COMPONENT_ LAYER_ MEDIA_ TYPE - Component layer media type (existing / used by Molt).
- WASM_
CONFIG_ MEDIA_ TYPE_ V0 - Molt config media type used by component artifacts (v0).
- WIT_
ARTIFACT_ TYPE_ V1 - WIT referrer artifactType (v1).
- WIT_
LAYER_ MEDIA_ TYPE_ V1 - WIT layer media type (v1).
Functions§
- auth_
from_ env - auth_
from_ header_ line - sanitize_
path_ segment - Sanitize a string for use as a directory name segment on common filesystems.