Crates.io | graph-api-derive |
lib.rs | graph-api-derive |
version | |
source | src |
created_at | 2025-04-12 22:39:11.39979+00 |
updated_at | 2025-04-20 22:44:15.066768+00 |
description | Derive macros for the graph-api ecosystem - provides type-safe vertex and edge extensions |
homepage | |
repository | https://github.com/BrynCooke/graph-api |
max_upload_size | |
id | 1631322 |
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-derive — where the type-safe magic happens for your graph models!
This crate provides powerful derive macros that enhance your graph data structures with compile-time safety and rich query capabilities. Say goodbye to manually writing boilerplate code for working with graph elements!
With graph-api-derive, you can transform simple enum declarations into feature-rich graph components with indexing, type-safe projections, and specialized query helpers.
Give us a model like this:
#[derive(Debug, Clone, VertexExt)]
pub enum Vertex {
Person {
#[index(hash)]
name: String,
#[index(range)]
age: u64,
#[index]
unique_id: Uuid,
#[index(range)]
username: String,
#[index(full_text)]
biography: String,
},
Project { name: String },
Rust,
}
#[derive(Debug, Clone, EdgeExt)]
pub enum Edge {
Knows { since: i32 },
Created,
Language { name: String },
}
And we'll generate a wealth of useful code for you:
Person<_>
and Knows<_>
projectionsPersonMut
and KnowsMut
Vertex::person_by_name("Bryn")
: Find people by nameVertex::person_by_age(30..50)
: Find people in an age rangeVertex::person_by_biography("graph")
: Find people whose biography mentions "graph"Edge::knows()
: Follow "knows" relationshipsEdge::created()
: Explore creation relationshipsMake your graph code more expressive, safer, and more enjoyable to write with graph-api-derive!
Learn more in the graph-api book.