1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! protoc-gen-connect-rust - Protoc plugin for generating ConnectRPC Rust service stubs.
//!
//! This plugin generates **service stubs only**:
//! - Server traits for implementing RPC handlers
//! - Service registration functions for the Router
//! - Client structs for making RPC calls
//!
//! Message types are NOT generated by this plugin; run `protoc-gen-buffa`
//! (or equivalent) separately. The service stubs reference message types
//! via absolute Rust paths configured with the `buffa_module` option.
//!
//! Usage with buf:
//! ```yaml
//! version: v2
//! plugins:
//! - local: protoc-gen-buffa
//! out: src/generated/buffa
//! opt: [views=true, json=true]
//! - local: protoc-gen-buffa-packaging
//! out: src/generated/buffa
//! strategy: all
//! - local: protoc-gen-connect-rust
//! out: src/generated/connect
//! opt: [buffa_module=crate::proto]
//! - local: protoc-gen-buffa-packaging
//! out: src/generated/connect
//! strategy: all
//! opt: [filter=services]
//! ```
//!
//! Then mount both trees in your crate:
//! ```rust,ignore
//! #[path = "generated/buffa/mod.rs"]
//! pub mod proto;
//! #[path = "generated/connect/mod.rs"]
//! pub mod connect;
//! ```
use io;
use Read;
use Write;
use Context;
use Result;
use Message;
use codegen;
use CodeGeneratorRequest;