Crate features / petgraph
Feature flags · petgraph 0.8.3 · from crates.io 2026-10-24
petgraph features: what each one does, and the line to copy
Short answerpetgraph 0.8.3 has 11 features. By default it turns on std, graphmap, stable_graph, matrix_graph; add default-features = false to start from nothing. It needs Rust 1.64 or newer.
Pick features
Every feature
| Feature | In default | Turns on |
|---|---|---|
all | unstable, quickcheck, matrix_graph, stable_graph, graphmap, rayon, dot_parser | |
dot_parser | std, dep:dot-parser, dep:dot-parser-macros | |
generate | nothing else (a switch the code checks) | |
graphmap | yes | nothing else (a switch the code checks) |
matrix_graph | yes | nothing else (a switch the code checks) |
quickcheck | std, dep:quickcheck, graphmap, stable_graph | |
rayon | std, dep:rayon, indexmap/rayon, hashbrown/rayon | |
serde-1 | serde, serde_derive | |
stable_graph | yes | serde?/alloc |
std | yes | indexmap/std |
unstable | generate |
dep:x turns on the optional dependency x; x/y turns on feature y of dependency x (with ?, only if x is already on).
MSRV history
The minimum Rust version petgraph declares (rust-version), and the release that changed it:
- 0.6.4 (2023-08-21): Rust 1.64
Stuck on an older compiler? Pin the last version that supports it, for example cargo update -p petgraph --precise <version>, or use resolver 3, which picks compatible versions for you.
More on petgraph
Real downloads, dependents and alternatives: petgraph crate data (1.5M real downloads a day, 1,570 dependents).
docs.rs feature list · crates.io · license MIT OR Apache-2.0 · edition 2021
Up next
Before you depend on itpetgraph crate dataReal downloads, dependents, alternatives.Read it next →Did this answer your question?