Weave documentation
Rust referenceloom-hub

loom-hub · registry

Source declarations, signatures and documentation for registry.

Source: sigil/weave/tools/loom-hub/src/registry.rs. SHA-256: 2a1cfcf28f41ef367d1f4fe4ac658db46a87e825af2bc44ec8538f9a6dc432f7.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

registry::REGISTRY_LENS

Canonical Lens database name used for the registry. Stable across versions so an existing on-disk store is always readable.

pub const REGISTRY_LENS: &str;

Source line: 21.

registry::registry_key

Build the canonical key bytes for a repo name. Centralized so both writers and readers stay aligned on the encoding.

pub fn registry_key(name: &str) -> Vec<u8>;

Source line: 25.

registry::RegistryError

Errors emitted by the registry layer.

#[derive(Debug, Error)]
pub enum RegistryError {
    /// The named repo was not found in this registry.
    #[error("registry entry not found: {0}")]
    NotFound(String),

    /// The Weave SDK returned an error.
    #[error("weave error: {0}")]
    Weave(String),

    /// (De)serialization of a registry entry failed.
    #[error("serialization error: {0}")]
    Json(#[from] serde_json::Error),

    /// Private recipient bundles must never enter the public registry.
    #[error("private repository bundles are forbidden in the public registry")]
    PrivateEntry,
}

Source line: 34.

registry::Result

Convenience result alias.

pub type Result<T> = std::result::Result<T, RegistryError>;

Source line: 53.

registry::Registry

Read/write handle for an owner's registry, riding on top of an existing [WeaveNode]. The node provides identity (used to sign the underlying Lens strand) and storage; this type adds only the repo-name → entry encoding.

pub struct Registry<'a> {

}

Source line: 65.

registry::Registry<'a>::open

Wrap an existing node. Idempotently opens the loom.registry Lens on first call so subsequent operations don't have to.

pub async fn open(node: &'a WeaveNode) -> Result<Self>;

Source line: 72.

registry::Registry<'a>::put

Publish (or overwrite) a registry entry. The Lens strand is signed by the owner's keypair, so callers need not sign the entry themselves — the strand block carries the signature.

pub async fn put(&self, entry: &RegistryEntry) -> Result<()>;

Source line: 80.

registry::Registry<'a>::get

Look up a single entry by repo name.

pub async fn get(&self, name: &str) -> Result<RegistryEntry>;

Source line: 91.

registry::Registry<'a>::try_get

Soft get that returns None if the entry is absent rather than erroring.

pub async fn try_get(&self, name: &str) -> Result<Option<RegistryEntry>>;

Source line: 109.

registry::Registry<'a>::delete

Remove an entry. Lens delete writes a tombstone to the strand, preserving auditable history.

pub async fn delete(&self, name: &str) -> Result<()>;

Source line: 119.

registry::Registry<'a>::list

Enumerate every registered repo, optionally filtered by a prefix over the repo name (post repo: prefix). Returns entries sorted lexicographically by key. Reads via Lens range stream.

pub async fn list(&self, name_prefix: Option<&str>) -> Result<Vec<RegistryEntry>>;

Source line: 128.

On this page