Weave documentation
Rust referenceloom-pr

loom-pr · store

Source declarations, signatures and documentation for store.

Source: sigil/weave/tools/loom-pr/src/store.rs. SHA-256: 5ec28399726b2d11bbe7f9242da262614983a6b644c2d5fce80e511571ad1f4b.

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.

store::PR_LENS

Canonical Lens database name. Stable across versions.

pub const PR_LENS: &str;

Source line: 10.

store::PrError

Errors raised by the store.

#[derive(Debug, Error)]
pub enum PrError {
    /// PR with the requested id was not found.
    #[error("PR not found: {0}")]
    NotFound(String),
    /// Underlying Weave error (Lens IO, identity, etc.).
    #[error("weave error: {0}")]
    Weave(String),
    /// (De)serialization failed.
    #[error("serialization error: {0}")]
    Json(#[from] serde_json::Error),
}

Source line: 14.

store::Result

Convenience result.

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

Source line: 27.

store::pr_key

Lens key for a PR document.

pub fn pr_key(id: &PrId) -> Vec<u8>;

Source line: 36.

store::approval_key

Lens key for an approval.

pub fn approval_key(pr_id: &PrId, approver_did: &str) -> Vec<u8>;

Source line: 44.

store::PrStore

Read/write handle. Like the registry, this is a thin wrapper that adds a stable encoding over the existing WeaveNode + Lens.

pub struct PrStore<'a> {

}

Source line: 55.

store::PrStore<'a>::open

Open the PR Lens (idempotent).

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

Source line: 61.

store::PrStore<'a>::put_pr

Persist a PR document (overwrites by id).

pub async fn put_pr(&self, pr: &Pr) -> Result<()>;

Source line: 67.

store::PrStore<'a>::get_pr

Look up by id.

pub async fn get_pr(&self, id: &PrId) -> Result<Pr>;

Source line: 75.

store::PrStore<'a>::try_get_pr

Soft-fail variant.

pub async fn try_get_pr(&self, id: &PrId) -> Result<Option<Pr>>;

Source line: 86.

store::PrStore<'a>::list_prs

List every PR (sorted by id). Range scan over the pr: prefix.

pub async fn list_prs(&self) -> Result<Vec<Pr>>;

Source line: 95.

store::PrStore<'a>::put_approval

Persist an approval (one per (pr_id, approver_did)).

pub async fn put_approval(&self, approval: &Approval) -> Result<()>;

Source line: 129.

store::PrStore<'a>::list_approvals

Range-scan every approval for a PR.

pub async fn list_approvals(&self, pr_id: &PrId) -> Result<Vec<Approval>>;

Source line: 137.

On this page