1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) 2026 vectorless developers
// SPDX-License-Identifier: Apache-2.0
//! Storage module for persisting document indices.
//!
//! This module provides:
//! - **Workspace** — An async directory-based document collection manager with LRU cache
//! - **Persistence** — Save/load document trees and metadata with atomic writes
//! - **Cache** — LRU cache for loaded documents
//! - **Lock** — File locking for multi-process safety
//! - **Backend** — Storage backend abstraction (file, memory, etc.)
//!
//! # Example
//!
//! ```rust,no_run
//! use vectorless::storage::{Workspace, PersistedDocument, DocumentMeta};
//! use vectorless::document::DocumentTree;
//!
//! # #[tokio::main]
//! # async fn main() -> vectorless::error::Result<()> {
//! // Create a workspace
//! let workspace = Workspace::new("./my_workspace").await?;
//!
//! // 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).await?;
//!
//! // Load it back (uses LRU cache)
//! let loaded = workspace.load_and_cache("doc-1").await?.unwrap();
//! # Ok(())
//! # }
//! ```
// Re-export main types
pub use ;
pub use Workspace;