Expand description
Shared layout primitives for OxGraph graph and hypergraph crates.
Three responsibilities live here, one namespace each:
- Index/word vocabulary (crate root:
LayoutIndex,LayoutWord,LayoutSnapshotWord,SnapshotWidth): the single sealed set of dense index widths, native/little-endian storage words, and the width-to-LE-word bijection shared by every layout and snapshot crate. CSR and BCSR add only thin section-kind-bearing sub-traits on top. - Build-time (
build): validate dense IDs against a known count, convertusizeslots back into a typed index width, flatten per-bucket payloads into CSR-style(offsets, items)pairs, and lower native index slices into explicit little-endian words. - Read-time (
integrity): walk borrowed offset arrays at view-open time and convert already-validated indexes infallibly.
The build and integrity helpers are deliberately not re-exported at the crate root: the root namespace carries only the vocabulary every layer is parameterized over, while builder and validation internals stay behind their module names.
LocalId is the one generic local-handle newtype every layout crate
aliases for its node/edge/vertex/hyperedge/incidence identities, and
IdSlice is the one slice-to-handle iterator they all reuse.
no_std + alloc (build-time primitives need Vec). No public domain
semantics. No dependency on any other oxgraph crate.
Modules§
Structs§
- Edge
Axis - Relation axis for binary graphs (an edge).
- Hyperedge
Axis - Relation axis for hypergraphs (a hyperedge).
- IdSlice
- Iterator that maps a borrowed slice of
LayoutWords into axis-branded handles, recovering each logical index and wrapping it withId::from. - Incidence
Axis - Incidence axis (a participant / endpoint).
- LocalId
- A dense local handle: an axis-branded index value.
- Node
Axis - Element axis for binary graphs (a node).
- Vertex
Axis - Element axis for hypergraphs (a vertex).
Traits§
- Axis
- Marker for a local-handle axis (node, edge, vertex, hyperedge, incidence).
- 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. - Snapshot
Width - A persisted unsigned width with its little-endian storage word.
- Zerocopy
Word - Borrowed offset or value word usable by offset-integrity primitives.
Functions§
- crc32c_
append - Continues a CRC-32C (Castagnoli, polynomial
0x1EDC_6F41) checksum overbytes, seeded with the result of a prior call (seed0starts a fresh checksum).