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
47
48
49
50
51
52
53
54
55
56
57
58
// SPDX-License-Identifier: Apache-2.0
//! `VectorSegmentExt` — pagedb segment operations for HNSW vector data.
//!
//! The `StorageEngine` trait handles sparse, sorted, key-value state. For
//! HNSW vector data (large, sequentially accessed, zero-copy win) pagedb
//! segments are more appropriate. This trait exposes exactly the three
//! operations the HNSW persistence layer needs without leaking pagedb types
//! into caller code.
//!
//! Only compiled on non-WASM targets because `pagedb::MmapView` (used by
//! `PagedbBacking`) requires mmap. WASM stays on the blob path.
use cratePagedbBacking;
use crateLiteError;
/// Extension trait: write, open, and delete HNSW vector segments backed by
/// pagedb encrypted segment files.
///
/// Implementors are responsible for translating between the generic NDVS byte
/// stream and the pagedb segment page layout.
///
/// This trait is object-safe so `StorageEngine` implementations can return
/// `Option<&dyn VectorSegmentExt>` via `as_vector_segment_ext()`.