Crates.io | graph-api-petgraph |
lib.rs | graph-api-petgraph |
version | |
source | src |
created_at | 2025-04-13 11:09:10.267183+00 |
updated_at | 2025-04-20 22:45:19.703038+00 |
description | Integration between graph-api and petgraph - use graph-api's traversal system with petgraph structures |
homepage | |
repository | https://github.com/BrynCooke/graph-api |
max_upload_size | |
id | 1631735 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Welcome to graph-api-petgraph — bridging the gap between the popular petgraph crate and the Graph-API ecosystem!
Already using petgraph for your graph data structures? Love its efficiency but wish it had more expressive traversal capabilities? This adapter brings the best of both worlds to your Rust projects!
This crate allows you to keep using petgraph's excellent StableGraph implementation while gaining access to all the intuitive traversal patterns and type-safety features of Graph-API. It's the ideal way to enhance your existing petgraph-based code without rewriting your storage layer.
With just a few lines of code, unlock powerful new capabilities:
fn main() {
// Your existing petgraph code
let mut graph = petgraph::stable_graph::StableGraph::new();
// Add some vertices and edges...
// Now enjoy the rich Graph-API traversal system!
let people = graph
.walk()
.vertices(VertexIndex::person())
.edges(EdgeIndex::knows().direction(Direction::Outgoing))
.tail()
.filter_by_person(|person, _| person.age() > 30)
.collect::<Vec<_>>();
}
This adapter implements the Graph-API traits for petgraph's StableGraph. Other petgraph graph types are not currently supported due to Rust's orphan rule limitations.
Explore the integration between two powerful graph libraries with graph-api-petgraph!
Learn more in the graph-api book.