Add Rust protobuf binding#277
Open
johannesschrimpf wants to merge 3 commits into
Open
Conversation
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
Contributor
There was a problem hiding this comment.
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.mdandCLAUDE.md, and adds Rust-specific.editorconfigindentation.
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.
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.