Feature flags
The umbrella crate's default feature set is empty. A feature is the only thing that pulls a layer in, so you compile only what you use:
cargo add oxgraph --features csr,algo-stdFeatures to layers
| Feature | Pulls in |
|---|---|
topology | Core capability traits for discrete topology. |
graph | Binary graph vocabulary: nodes, edges, directed traversal. |
hyper | Hypergraph vocabulary: vertices, hyperedges, participants. |
csr | Compressed-sparse-row graph views over slices. |
csc | Inbound (compressed-sparse-column) views for reverse traversal. |
hyper-bcsr | Directed bipartite-CSR hypergraph views. |
snapshot | Read and validate snapshots (no_std, no allocation). |
snapshot-alloc | Build snapshots (adds alloc). |
algo, algo-alloc, algo-std | BFS and PageRank at the matching allocation tier. |
graph-build, hyper-build | Append/freeze builders that produce a layout, then a snapshot. |
property-arrow | Arrow-backed named, typed property layers. |
db | The embedded database (oxgraph-db). |
postgres | The Postgres-backed engine (also enables csc). |
full | Everything. |
Each feature corresponds to a crate in the crate family; you can also depend on those crates directly if you want a tighter dependency graph.
Allocation tiers
Several layers ship at no_std, alloc, and std tiers, so you only pull in an
allocator (or std) when your target allows it. oxgraph-algo is the clearest
example:
| Tier | Feature | For |
|---|---|---|
no_std | algo | Bare-metal / embedded; you pass in scratch buffers. |
alloc | algo-alloc | Heap available, no std. |
std | algo-std | Full standard library. |
Snapshots split the same way: snapshot reads and validates without allocating;
snapshot-alloc adds the builder.
Borrow, don't parse
Reading a snapshot does not deserialize it. snapshot validates the byte
container once and hands back typed slices borrowed straight from the bytes —
the bytes → validate → view → traverse pipeline. That is why opening a graph
is closer to a memory-map than a parse, and why structures that cross an I/O
boundary derive zero-copy layout traits rather than being rebuilt on the heap.
See Concepts for the reasoning.