Skip to main content

Module storage

Module storage 

Source
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§

DocumentMeta
Metadata for a persisted document.
DocumentMetaEntry
Lightweight metadata entry for the index.
PageContent
Content for a single page.
PersistedDocument
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).