oxgraph-layout-util
Shared layout primitives for oxgraph: builder helpers + offset-integrity validation.
The support crate every concrete oxgraph
layout reuses. no_std (+ alloc for build-time helpers), unsafe-free, no
dependency on any other oxgraph crate.
What it is
Three responsibilities live here, one namespace each:
- Index/word vocabulary (crate root):
LayoutIndex,LayoutWord,LayoutSnapshotWord, andSnapshotWidth, the single sealed set of dense index widths, native and little-endian storage words, and the width-to-LE-word bijection shared by every layout and snapshot crate.LocalIdis the one generic local-handle newtype layout crates alias for their node/edge/vertex/hyperedge/incidence identities, andIdSliceis the one slice-to-handle iterator they all reuse. - Build-time (
buildmodule): validate dense IDs against a known count, flatten per-bucket payloads into CSR-style(offsets, items)pairs, and lower native index slices into explicit little-endian words. - Read-time (
integritymodule): walk borrowed offset arrays at view-open time and convert already-validated indexes infallibly.
The crate also provides the CRC-32C (Castagnoli) checksum function
(crc32c_append) that oxgraph-snapshot writers and verified readers plug
in. No public domain semantics: this crate knows nothing about graphs or
hypergraphs.
Where it sits
oxgraph-layout-util ← this crate
├── oxgraph-snapshot byte container (no-alloc dependency)
├── oxgraph-csr / oxgraph-csc borrowed graph layouts
└── oxgraph-hyper-bcsr borrowed hypergraph layout
Features
| Feature | Effect |
|---|---|
alloc (default) |
Enables the build-time primitives that allocate (build_offset_index, slice_to_le). |
none (default-features = false) |
Keeps the index/word vocabulary, LocalId, IdSlice, and the offset-integrity checks, with no allocation. |
Documentation
See docs.rs/oxgraph-layout-util for
the full API and the
oxgraph family README for how
the layers fit together. Also available through the umbrella crate:
cargo add oxgraph --features layout.
License
MIT. See LICENSE.