weave-loom · index
Source declarations, signatures and documentation for index.
Source: sigil/weave/tools/loom/src/index.rs. SHA-256: d7d287f18cfb69e7d1a1f957e11c3868094ee49832b413866c1b389969ee3bdf.
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.
index::IndexEntry
One staged file.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct IndexEntry {
/// Hex BLAKE3 of the blob content.
pub blob: String,
/// File mode at stage time.
pub mode: FileMode,
/// File size in bytes.
pub size: u64
}Source line: 18.
index::Index
In-memory representation of the staging index.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Index {
/// Schema version.
pub version: u32,
/// Path → entry map. `BTreeMap` so the on-disk encoding is sorted and
/// stable.
pub entries: BTreeMap<String, IndexEntry>
}Source line: 29.
index::Index::new
Empty index with the current schema version.
pub fn new() -> Self;Source line: 48.
index::Index::load
Read the index from the given Lens database. Returns an empty index if no document has been written yet (a fresh repo).
pub async fn load(node: &WeaveNode, lens_name: &str) -> Result<Self>;Source line: 57.
index::Index::save
Persist the index to Lens.
pub async fn save(&self, node: &WeaveNode, lens_name: &str) -> Result<()>;Source line: 69.
index::Index::validate
Validate the local projection against the same portable tree profile enforced for signed commits before it can influence a command.
pub fn validate(&self) -> Result<()>;Source line: 78.
index::Index::put
Replace the entry for path (forward-slash form).
pub fn put(&mut self, path: impl Into<String>, entry: IndexEntry);Source line: 102.
index::Index::remove
Remove the entry for path if present; returns the prior entry.
pub fn remove(&mut self, path: &str) -> Option<IndexEntry>;Source line: 107.
index::Index::is_empty
True when no entries are staged.
pub fn is_empty(&self) -> bool;Source line: 112.
index::Index::get
Look up the entry for path.
pub fn get(&self, path: &str) -> Option<&IndexEntry>;Source line: 120.