Skip to main content

quiver_core/
lib.rs

1// SPDX-License-Identifier: AGPL-3.0-only
2//! Quiver's storage engine: from-scratch, durable, crash-safe, encrypted-at-rest
3//! storage built on 16 KiB pages, a write-ahead log, and a versioned manifest.
4//!
5//! This crate owns all durable state (ADR-0004 / ADR-0005) and is deliberately
6//! built without an embedded KV/DB engine. Phase 1 ships the foundational
7//! primitives; the columnar segment layout, the store-level engine, and crash
8//! recovery build on top of them.
9//!
10//! - [`page`] — the 16 KiB page: the unit of checksum, encryption, and I/O,
11//!   with a swappable [`page::PageCodec`] (plaintext now, AEAD with
12//!   `quiver-crypto`).
13//! - [`wal`] — the write-ahead log: the durability anchor. An acknowledged write
14//!   is `fsync`'d to the log first, so it survives `kill -9`.
15//! - [`manifest`] — the versioned catalog, made current via an atomic
16//!   write-new + fsync + rename of `CURRENT`.
17//! - [`store`] — the [`store::Store`] engine: the write path, checkpointing, and
18//!   crash recovery that compose the primitives above, over internal sealed
19//!   segments.
20//! - [`descriptor`] — collection schema; [`ids`] — typed [`ids::Lsn`] /
21//!   [`ids::CollectionId`].
22
23mod blockfile;
24pub mod descriptor;
25pub mod error;
26pub mod ids;
27pub mod keyring;
28pub mod manifest;
29pub mod page;
30mod paged;
31pub mod sec;
32mod segment;
33pub mod store;
34pub mod wal;
35
36pub use descriptor::{
37    Descriptor, DistanceMetric, Dtype, FieldType, FilterableField, IndexKind, IndexSpec,
38    VectorEncryption,
39};
40pub use error::{CoreError, Result};
41pub use ids::{CollectionId, Lsn};
42pub use keyring::{KeyRing, SingleCodecKeyRing};
43pub use sec::{SecPredicate, SecValue};
44pub use store::{CommitObserver, Record, Store};
45pub use wal::{WalEntry, WalOp};