Skip to content

feat(rust): expose edge builder API - #977

Closed
GTrunSec wants to merge 1 commit into
apache:mainfrom
GTrunSec:feat/rust-edge-builder
Closed

GTrunSec wants to merge 1 commit into
apache:mainfrom
GTrunSec:feat/rust-edge-builder

Conversation

@GTrunSec

Copy link
Copy Markdown

Reason for this PR

Closes #976.

The in-tree Rust binding exposes vertex data builders and edge metadata, but it cannot write edge data even though the C++ implementation already owns graphar::builder::Edge and EdgesBuilder. Rust consumers therefore cannot stay on the upstream GraphAr writer path for graph-shaped data.

What changes are included in this PR?

  • expose safe Rust Edge and EdgesBuilder wrappers over the existing C++ implementation;
  • support endpoint inspection and bool/i32/i64/f32/f64/string edge properties;
  • reject negative internal vertex IDs and unavailable adjacency layouts;
  • use upstream strong schema validation for every added edge;
  • propagate Arrow include paths returned by pkg-config into the CXX bridge;
  • retain the original pkg-config error in build failures for actionable diagnostics.

No GraphAr encoding, metadata format, or chunk layout is reimplemented in Rust.

Are these changes tested?

Yes. New tests cover endpoint/property access, negative IDs, successful upstream chunk writing, unavailable adjacency layouts, and strong schema rejection. Locally:

  • cargo test: 58 passed;
  • cargo clippy --tests --no-deps -- -D warnings: passed;
  • cargo test --doc: passed;
  • cargo doc --lib --no-deps: passed;
  • cargo fmt --all -- --check: passed.

Are there any user-facing changes?

Yes. Rust users gain public graphar_rs::builder::{Edge, EdgesBuilder} APIs. Existing APIs are unchanged.

Checklist

  • I have performed a self-review of my own code.
  • I have formatted my own code using make cpplint before submitting when changed files are in the cpp directory. (No files under cpp/ changed.)
  • I have performed pre-commit run on the changed files before submission; the Rust format gate was also run directly through the project Cargo environment.
  • I have added tests to prove my changes are effective.

@GTrunSec GTrunSec closed this Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(rust): expose edge builder API

1 participant