Skip to main content

Crate molt_registry_client

Crate molt_registry_client 

Source
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/v1 endpoints: .../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§

InterfacesResponse
OciWasmClient
PulledComponentWasm
PushWitResult
ReferrerDescriptor
RegistryEndpoint
SearchQuery
SearchResponse
SearchResult
WasmV1Client
WitRequest
WitTextResponse

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.