Skip to main content

Crate pagedb

Crate pagedb 

Source
Expand description

Encrypted, portable, embedded page store exposing two surfaces: a B+ tree for sorted byte-table workloads (ACID transactions, range scans) and a Segment File API for engine-owned append-mostly encrypted files (vectors, columnar blocks, FTS postings).

Re-exports§

pub use options::OpenOptions;
pub use options::RetainPolicy;

Modules§

options
OpenOptions — explicit memory budgets for a Db instance.
vfs
Virtual file-system abstraction: File trait, lock primitives, vectored I/O.

Structs§

ApplyStats
Statistics returned by apply_incremental.
CommitId
Monotonically increasing commit sequence number.
CompactBudget
Per-call budget for Db::compact_step.
CompactProgress
Progress report returned by Db::compact_step.
CompactStats
Statistics returned by Db::compact_now.
CounterRef
A handle to a named durable monotonic counter, scoped to a WriteTxn.
Db
Top-level handle to an open database.
DbStats
Point-in-time snapshot of database runtime metrics.
DeepWalkReport
Full report produced by run_deep_walk.
DriftIssue
A catalog-vs-disk discrepancy.
ExtentRef
Bulk-read reference: a contiguous range starting at start_page_id of length count.
GcStats
Statistics returned by Db::gc_now.
MmapView
A read-only zero-copy view over already-decrypted segment data.
PageIssue
A single page-level issue found during deep walk.
ReadTxn
A snapshot-isolated read handle. Holds the BTree root and allocation cursor at the time the transaction was opened. Unregisters automatically on drop.
RealmId
Opaque cryptographic isolation scope identifier.
RealmQuotas
Catalog value for a quota row. Default = no caps.
ScratchOffset
Opaque handle returned by SpillScope::append. Pass to SpillScope::read to decrypt and retrieve the bytes.
SecretKey
256-bit key-encryption key supplied by the embedder.
SegmentIssue
An issue found in a segment file during deep walk.
SegmentMeta
Catalog value for a segment row.
SegmentReader
SegmentWriter
SnapshotStats
Statistics returned by a full or incremental snapshot export operation.
SpillScope
A borrowed view into an active WriteTxn that offers AEAD-encrypted spill storage in a per-transaction tmp file.
WriteTxn
An exclusive write transaction. At most one WriteTxn exists per Db at any time — the writer mutex enforces this. Either commit or abort must be called; if the WriteTxn is dropped without either, dirty pages are silently discarded (equivalent to abort).

Enums§

CipherId
On-wire cipher_id byte values. The numeric values are stable and part of the persisted format.
CorruptionDetail
Per-reason detail for PagedbError::Corruption. Each variant carries exactly the fields the failure-mode contract specifies — no optional fields, no field reuse across reasons.
DbMode
The operating mode of an open Db handle.
Evictable
Whether a segment is authoritative or replaceable under quota pressure.
PagedbError
Authoritative error type for every fallible operation in this crate.
QuotaKind
Quota failure reason, distinguishing which resource was exhausted.
ReaderStallPolicy
What to do when an open reader pins resources the writer needs to reclaim.
SegmentKind
Engine-defined segment type tag. Only Unspecified ships today; engine adapters add concrete variants later, so this is #[non_exhaustive] and growing it stays a non-breaking change.
SegmentPageKind
Segment-legal page kind subset.

Functions§

run_deep_walk
Run a deep walk against an already-opened Db<V>.

Type Aliases§

PageId
Page identifier within a segment file.
Result
Convenience alias for fallible operations in this crate.