Expand description
Borrowed compressed-sparse-row graph views.
oxgraph-csr provides the first concrete graph layout for the substrate. A
CsrGraph borrows validated CSR offset and target slices and implements
storage-agnostic graph traits from oxgraph-graph.
CSR is optimized for outgoing traversal. Incoming traversal requires a CSC index or another reverse index and is intentionally not implemented here.
§Optional builder
The build feature enables append-only [build::GraphBuilder] and
[build::WeightedGraphBuilder] types, plus snapshot export helpers, in
the [build] submodule. The additional build-property-arrow feature
enables property-snapshot export via oxgraph-property.
§Snapshot section kinds
| Family | Base | Description |
|---|---|---|
CSR_OFFSETS | SNAPSHOT_KIND_CSR_OFFSETS_BASE | CSR offsets array (node_count + 1 little-endian words) |
CSR_TARGETS | SNAPSHOT_KIND_CSR_TARGETS_BASE | CSR targets array (one little-endian word per edge) |
Each persisted kind is BASE | WIDTH_CODE, where
SnapshotWidth::WIDTH_CODE selects the little-endian word width in the
low two bits (0b00 = u16, 0b01 = u32, 0b10 = u64).
CsrSnapshotIndex derives the per-width kinds. All section-kind
constants are perf: unspecified — compile-time u32 tags.
Structs§
- CsrGraph
- Borrowed compressed-sparse-row graph view.
- CsrOut
Edges - Iterator over outgoing CSR edge slots.
Enums§
- CsrError
- CSR validation error.
- CsrSnapshot
Error - Error returned when a snapshot cannot be opened as a CSR graph.
Constants§
- SNAPSHOT_
CSR_ SECTION_ VERSION - Section version written and expected for CSR offsets/targets payloads.
- SNAPSHOT_
KIND_ CSR_ OFFSETS_ BASE - 4-aligned base section kind for CSR offsets arrays; the persisted kind is
BASE | WIDTH_CODEfor the offsets word width. - SNAPSHOT_
KIND_ CSR_ TARGETS_ BASE - 4-aligned base section kind for CSR targets arrays; the persisted kind is
BASE | WIDTH_CODEfor the targets word width.
Traits§
- CsrSnapshot
Index - Width-specific section-kind tags for persisted CSR offsets/targets payloads.
- Layout
Index - Unsigned dense ID width usable by graph and hypergraph layouts and builders.
- Layout
Snapshot Word - A little-endian storage word usable in persisted snapshot payloads.
- Layout
Word - A native-host or little-endian word carrying a typed dense
LayoutIndex.
Type Aliases§
- CsrEdge
Id - Local edge ID for
CsrGraph. - CsrNative
Graph - Native borrowed CSR graph alias.
- CsrNode
Id - Local node ID for
CsrGraph. - CsrSnapshot
Graph - Snapshot-backed little-endian CSR graph alias.