Skip to content

Add Rust protobuf binding#277

Open
johannesschrimpf wants to merge 3 commits into
masterfrom
rust
Open

Add Rust protobuf binding#277
johannesschrimpf wants to merge 3 commits into
masterfrom
rust

Conversation

@johannesschrimpf

@johannesschrimpf johannesschrimpf commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Add a Rust crate that compiles the proto definitions at build time using prost + protox (no protoc required), exposing the generated types via rust/src/lib.rs.

  • rust/build.rs: build-time codegen with protox
  • rust/tests/roundtrip.rs: round-trip and WKT integration tests
  • README.md, CLAUDE.md: document the Rust crate
  • .editorconfig: Rust override

Add a Rust crate that compiles the proto definitions at build time using
prost + protox (no protoc required), exposing the generated types via
rust/src/lib.rs.

- rust/build.rs: build-time codegen with protox
- rust/tests/roundtrip.rs: round-trip and WKT integration tests
- README.md, CLAUDE.md: document the Rust crate
- .editorconfig: Rust override

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Rust language binding for this repository’s protobuf definitions by introducing a rust/ crate that performs build-time code generation using protox + prost (no protoc dependency), plus basic round-trip tests and documentation updates describing how to build/use it.

Changes:

  • Introduces rust/ crate (blueye-protocol) with build-time codegen and re-exports.
  • Adds Rust integration tests covering message and WKT (Timestamp) round-trips.
  • Documents Rust usage/build commands in README.md and CLAUDE.md, and adds Rust-specific .editorconfig indentation.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
specs/2026-06-10-rust-binding-plan.md Implementation plan for the Rust binding work.
specs/2026-06-10-rust-binding-design.md Design doc describing layout/codegen/testing approach.
rust/Cargo.toml Defines the new blueye-protocol crate and dependencies.
rust/Cargo.lock Locks Rust dependency versions for the new crate.
rust/build.rs Build script that compiles protos via protox and generates Rust via prost-build.
rust/src/lib.rs Includes generated output and re-exports crate API.
rust/tests/roundtrip.rs Integration tests for encode/decode and WKT mapping.
rust/.gitignore Ignores Rust target directory.
README.md Adds a Rust section with build/test and git dependency instructions.
CLAUDE.md Adds Rust build/test commands and notes build-time codegen.
.editorconfig Sets 4-space indentation for Rust files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rust/build.rs
Emit cargo:rerun-if-changed per .proto file so edits to an existing
proto retrigger codegen. Directory mtime alone doesn't change when a
file inside it is edited, so generated code could go stale. The
directory watch is kept so added/removed files still retrigger.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Comment thread rust/build.rs Outdated
Comment thread README.md
Collect directory entries into a Result instead of dropping per-entry
errors via entry.ok(). An unreadable entry would otherwise silently
shrink the proto list and produce codegen with missing types; now it
fails the build with a useful error.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants