Skip to content

Add anthropics/connect-rust plugin v0.3.2#2334

Open
iainmcgin wants to merge 1 commit intobufbuild:mainfrom
iainmcgin:add-connectrpc-rust-plugin
Open

Add anthropics/connect-rust plugin v0.3.2#2334
iainmcgin wants to merge 1 commit intobufbuild:mainfrom
iainmcgin:add-connectrpc-rust-plugin

Conversation

@iainmcgin
Copy link
Copy Markdown

@iainmcgin iainmcgin commented Mar 17, 2026

Adds the protoc-gen-connect-rust plugin for ConnectRPC Rust service bindings, under the new top-level anthropics org as requested in earlier review.

About connect-rust

connect-rust is a Tower-based Rust implementation of the ConnectRPC protocol:

  • Three protocols: Connect, gRPC, gRPC-Web - same service impl handles all three
  • Full conformance: 3600 server tests, 2580/1454/2838 client tests across Connect/gRPC/gRPC-Web
  • Zero-copy request handling via buffa view types - request.name is a &str borrow into the decoded buffer
  • Tower integration: composes with axum, hyper, tower middleware

Crates on crates.io: connectrpc, connectrpc-codegen, connectrpc-build.

Plugin layering

The plugin emits service stubs only - server traits, typed clients, monomorphic dispatchers. Message types come from buf.build/anthropics/buffa (declared in deps:). Generated stubs reference message types via absolute Rust paths (crate::<buffa_sdk>::pkg::Type).

Dockerfile note: the protoc-gen-connect-rust binary is a [[bin]] target inside the connectrpc-codegen crate, so cargo install connectrpc-codegen is what produces it.

Open question: extern_path injection

The plugin needs to know where the buffa SDK crate lives to emit the right paths. It accepts either extern_path=.=<rust_path> (same format as tonic/prost) or the shorthand buffa_module=<rust_path>.

I left opts: [] with a comment in the yaml because I assume BSR injects extern_path=.=::<buffa_sdk_crate_name> at invocation time based on the deps: config - same as it does for tonic referencing prost types. Would appreciate confirmation of the exact value BSR injects so I can verify the plugin handles it correctly.

Dependencies

Depends on the buffa plugin landing first: #2333

Process note

CONTRIBUTING.md asks for an issue first - happy to open one if you would prefer to discuss before reviewing. Filed as draft.

@bufdev
Copy link
Copy Markdown
Member

bufdev commented Mar 19, 2026

#2333 (comment)

@iainmcgin iainmcgin force-pushed the add-connectrpc-rust-plugin branch from 61b03f3 to eca199a Compare April 2, 2026 21:24
@iainmcgin iainmcgin changed the title Add connectrpc/rust plugin v0.2.0 Add anthropics/connect-rust plugin v0.2.0 Apr 2, 2026
@iainmcgin iainmcgin force-pushed the add-connectrpc-rust-plugin branch from eca199a to f42cc7a Compare April 2, 2026 21:36
@iainmcgin iainmcgin changed the title Add anthropics/connect-rust plugin v0.2.0 Add anthropics/connect-rust plugin v0.3.1 Apr 2, 2026
@iainmcgin iainmcgin force-pushed the add-connectrpc-rust-plugin branch from f42cc7a to 92259e7 Compare April 3, 2026 01:20
@iainmcgin iainmcgin marked this pull request as ready for review April 3, 2026 15:54
@iainmcgin
Copy link
Copy Markdown
Author

changed to crate ref instead of github ref 👍

@iainmcgin iainmcgin force-pushed the add-connectrpc-rust-plugin branch from 92259e7 to 314f1da Compare April 3, 2026 18:34
@iainmcgin iainmcgin changed the title Add anthropics/connect-rust plugin v0.3.1 Add anthropics/connect-rust plugin v0.3.2 Apr 3, 2026
connect-rust is a Tower-based Rust implementation of the ConnectRPC
protocol. The plugin emits service stubs (server traits, typed clients,
monomorphic dispatchers) for the Connect, gRPC, and gRPC-Web protocols
from a single service implementation. Passes the full ConnectRPC
conformance suite.

Generated stubs reference message types via absolute Rust paths into
the buffa SDK crate (declared as a plugin dep). The plugin accepts
`extern_path=.=<rust_path>` (or shorthand `buffa_module=<rust_path>`)
to point at the buffa SDK location, same format as tonic/prost.

Crates: https://crates.io/crates/connectrpc-codegen
Repo: https://github.com/anthropics/connect-rust
@iainmcgin iainmcgin force-pushed the add-connectrpc-rust-plugin branch from 314f1da to b60cff4 Compare April 3, 2026 18:55
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