Skip to main content

Crate oxgraph_csr

Crate oxgraph_csr 

Source
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

FamilyDescription
CSR_OFFSETS_*CSR offsets array (node_count + 1 little-endian words)
CSR_TARGETS_*CSR targets array (one little-endian word per edge)

The _U16 / _U32 / _U64 suffix selects the little-endian word width. All section-kind constants are perf: unspecified — compile-time u32 tags.

Structs§

CsrGraph
Borrowed compressed-sparse-row graph view.
CsrOutEdges
Iterator over outgoing CSR edge slots.

Enums§

CsrError
CSR validation error.
CsrSnapshotError
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_U16
Section kind for a CSR u16 offsets array.
SNAPSHOT_KIND_CSR_OFFSETS_U32
Section kind for a CSR u32 offsets array.
SNAPSHOT_KIND_CSR_OFFSETS_U64
Section kind for a CSR u64 offsets array.
SNAPSHOT_KIND_CSR_TARGETS_U16
Section kind for a CSR u16 targets array.
SNAPSHOT_KIND_CSR_TARGETS_U32
Section kind for a CSR u32 targets array.
SNAPSHOT_KIND_CSR_TARGETS_U64
Section kind for a CSR u64 targets array.

Traits§

CsrSnapshotIndex
Width-specific section-kind tags for persisted CSR offsets/targets payloads.
LayoutIndex
Unsigned dense ID width usable by graph and hypergraph layouts and builders.
LayoutSnapshotWord
A little-endian storage word usable in persisted snapshot payloads.
LayoutWord
A native-host or little-endian word carrying a typed dense LayoutIndex.

Type Aliases§

CsrEdgeId
Local edge ID for CsrGraph.
CsrNativeGraph
Native borrowed CSR graph alias.
CsrNodeId
Local node ID for CsrGraph.
CsrSnapshotGraph
Snapshot-backed little-endian CSR graph alias.