Expand description
Storage module for persisting document indices.
This module provides:
- Workspace — A directory-based document collection manager with LRU cache
- Persistence — Save/load document trees and metadata
§Example
use vectorless::storage::{Workspace, PersistedDocument, DocumentMeta};
use vectorless::core::DocumentTree;
// Create a workspace
let mut workspace = Workspace::new("./my_workspace")?;
// Add a document
let meta = DocumentMeta::new("doc-1", "My Document", "md");
let tree = DocumentTree::new("Root", "Content");
let doc = PersistedDocument::new(meta, tree);
workspace.add(&doc)?;
// Load it back (uses LRU cache)
let loaded = workspace.load("doc-1")?.unwrap();Structs§
- Document
Meta - Metadata for a persisted document.
- Document
Meta Entry - Lightweight metadata entry for the index.
- Page
Content - Content for a single page.
- Persisted
Document - A persisted document index containing tree and metadata.
- Workspace
- A workspace for managing indexed documents.
Functions§
- load_
document - Load a document from a JSON file.
- load_
index - Load the workspace index.
- save_
document - Save a document to a JSON file.
- save_
index - Save the workspace index (metadata for all documents).