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
// SPDX-License-Identifier: Apache-2.0
//! `GraphSegmentExt` — pagedb segment operations for CSR adjacency data.
//!
//! The `StorageEngine` trait handles sparse, sorted, key-value state. For CSR
//! adjacency blobs (one per graph collection, large, sequentially read on
//! cold-open restore) pagedb segments are the appropriate backing. A single
//! segment per collection reduces B+ tree pressure from O(edge_count) entries
//! to O(1) per collection.
//!
//! `GraphHistory` rows (bitemporal edge/node history) remain on the B+ tree
//! (`Namespace::GraphHistory`) — they are genuinely sparse and sorted by
//! (entity_id, valid_time).
//!
//! Only compiled on non-WASM targets. WASM stays on the KV blob path.
use crateLiteError;
/// Extension trait: write, open, and delete CSR adjacency segments backed
/// by pagedb encrypted segment files.
///
/// One segment per collection (e.g. `"social_graph"`). The segment contains
/// the serialized CSR checkpoint bytes exactly as produced by
/// `CsrIndex::checkpoint_to_bytes()` — no additional framing beyond the
/// 8-byte length-prefix envelope used to survive pagedb's page-boundary
/// zero-padding.
///
/// This trait is object-safe so `StorageEngine` implementations can return
/// `Option<&dyn GraphSegmentExt>` via `as_graph_segment_ext()`.