Skip to main content

pbrs_grpc/
lib.rs

1//! An HTTP/2 gRPC client and server for [`pbrs`] and optional Prost messages.
2//!
3//! Supports unary and streaming calls, generated service stubs, TLS,
4//! compression, and configurable connection, RPC, and message limits.
5//! Optional features add Tower and tonic integration.
6//!
7//! Uses Tokio and an embedded `h2` backend. gzip and deflate use
8//! `miniz_oxide`; TLS uses rustls with
9//! [Graviola](https://crates.io/crates/graviola) by default.
10//! Supply application-owned TLS configs through [`ServerTls::from_rustls`]
11//! and [`ClientTls::from_rustls`].
12//!
13//! # Quickstart
14//!
15//! Given `proto/hello.proto`:
16//!
17//! ```proto
18//! syntax = "proto3";
19//! package helloworld;
20//!
21//! service Greeter {
22//!   rpc SayHello (HelloRequest) returns (HelloReply);
23//! }
24//!
25//! message HelloRequest { string name = 1; }
26//! message HelloReply   { string message = 1; }
27//! ```
28//!
29//! generate client and server stubs from `build.rs`:
30//!
31//! ```no_run
32//! // build.rs
33//! fn main() {
34//!     pbrs::codegen::compile_protos(&["proto/hello.proto"], &["proto"])
35//!         .expect("codegen");
36//! }
37//! ```
38//!
39//! then implement the generated trait and serve it:
40//!
41//! ```no_run
42//! use pbrs_grpc::hello::{Greeter, GreeterServer, HelloReply, HelloRequest};
43//! use pbrs_grpc::{Request, Response, Status};
44//!
45//! struct MyGreeter;
46//!
47//! impl Greeter for MyGreeter {
48//!     async fn say_hello(
49//!         &self,
50//!         request: Request<HelloRequest>,
51//!     ) -> Result<Response<HelloReply>, Status> {
52//!         let mut reply = HelloReply::new();
53//!         reply.set_message(format!("hello {}", request.get_ref().name()));
54//!         Ok(Response::new(reply))
55//!     }
56//! }
57//!
58//! # async fn example() -> Result<(), Status> {
59//! GreeterServer::new(MyGreeter)
60//!     .serve("127.0.0.1:50051".parse().expect("addr"))
61//!     .await
62//! # }
63//! ```
64//!
65//! Methods you omit on the generated trait answer `UNIMPLEMENTED`.
66//!
67//! The client side mirrors it:
68//!
69//! ```no_run
70//! # async fn example() -> Result<(), pbrs_grpc::Status> {
71//! use pbrs_grpc::hello::{GreeterClient, HelloRequest};
72//! use pbrs_grpc::Request;
73//!
74//! let client = GreeterClient::connect("127.0.0.1:50051").await?;
75//!
76//! let mut req = HelloRequest::new();
77//! req.set_name("world");
78//! let reply = client.say_hello(Request::new(req)).await?;
79//! println!("{}", reply.get_ref().message());
80//! # Ok(())
81//! # }
82//! ```
83//!
84//! `examples/greeter` is a complete external crate with its own proto,
85//! `build.rs`, health, and reflection services.
86//!
87//! See [`docs/grpc.md`] in the repository for the full guide, and
88//! [`docs/benchmarks.md`] for measured numbers.
89//!
90//! [`docs/grpc.md`]: https://github.com/mingley/pure-protobuf/blob/main/docs/grpc.md
91//! [`docs/benchmarks.md`]: https://github.com/mingley/pure-protobuf/blob/main/docs/benchmarks.md
92//!
93//! # Main APIs
94//!
95//! | Purpose | Types |
96//! |---|---|
97//! | Servers and routing | [`Server`], [`Router`], [`Service`], [`Rpc`], [`Incoming`] |
98//! | Clients and calls | [`Channel`], [`ChannelConfig`], [`Call`], [`CallHandle`] |
99//! | TLS and peer identity | [`Identity`], [`ServerTls`], [`ClientTls`], [`PeerIdentity`] |
100//! | Request and response data | [`Request`], [`Response`], [`Metadata`], [`Extensions`] |
101//! | Errors | [`Status`], [`Code`], [`ErrorDetails`], [`Any`] |
102//! | Streaming | [`Streaming`], [`StreamSender`], [`Framed`] |
103//! | Interceptors | [`Interceptor`], [`ClientInterceptor`], [`ResponseInterceptor`] |
104//! | Limits | [`ServerConfig`], [`ChannelConfig`], [`MessageLimits`] |
105//! | Built-in services | [`health`], [`reflection`], [`channelz`] |
106//!
107//! Client interceptors run before a stream opens; returning an error sends
108//! nothing. Server interceptors run before the handler. Response interceptors
109//! run after a successful handler result or received response. Attach hooks
110//! with the corresponding `intercept` and `on_response` methods; repeated
111//! attachments run in order.
112//!
113//! Request overrides can change timeout, compression, and wait-for-ready.
114//! The `*_is_set` methods tell an interceptor whether a caller supplied an
115//! override. Configuration getters expose the channel or server defaults.
116//! [`Outgoing::connected`] is a snapshot when the hook runs, not a readiness
117//! guarantee. See each method for its override and clearing rules.
118//!
119//! Rich errors preserve unknown detail types through [`ErrorDetails::unknown`].
120//! Reflection also serves the v1alpha path for older clients.
121//!
122//! # Safety
123//!
124//! The protocol-facing modules restrict `unsafe`: gRPC
125//! framing, transport, TLS, compression, codec, resolver,
126//! load-balancing, authorization, binary logging, service-config, metadata,
127//! status, request, response, and stream code all carry
128//! `#[forbid(unsafe_code)]`. Server call-record initialization, cancellation
129//! flag recycling, HTTP name storage, static HTTP value copies, and the
130//! private HTTP/2 backend have scoped exceptions.
131//! Their allocation, synchronization and lifetime invariants need independent
132//! review and targeted safety checks; the transport seam's forbid remains intact.
133//! Resource limits additionally bound peer-controlled work and memory.
134//!
135//! ## Threat model
136//!
137//! The peer is assumed hostile and able to send any bytes at any rate. Each
138//! defence below targets a particular stage of work. These limits do not imply
139//! a total process-memory bound.
140//!
141//! | Attack | Defence | Default |
142//! |---|---|---|
143//! | Huge declared message length | Refused from the 5-byte frame header without a claim-sized carry reservation; HTTP/2 may already hold DATA | 4 MiB ([`MessageLimits`]) |
144//! | Decompression bomb | Bounded inflate that stops one byte past the cap; opt out of inbound gzip entirely | 4 MiB ([`gzip::decode_limited`]); opt-out [`ServerConfig::accept_compressed`] / [`ChannelConfig::accept_compressed`] |
145//! | Metadata flood | HTTP/2 `SETTINGS_MAX_HEADER_LIST_SIZE` | 16 KiB ([`ServerConfig::max_header_list_size`]) |
146//! | Stream flood | HTTP/2 `SETTINGS_MAX_CONCURRENT_STREAMS`; extras wait, they are not `RESOURCE_EXHAUSTED` | 256 ([`ServerConfig::max_concurrent_streams`]) |
147//! | Transport buffering | Per-connection receive window and per-stream send-buffer threshold | 16 MiB / 1 MiB |
148//! | Slow reader amplification | Capacity is released only after a chunk is handed on, so a slow handler throttles the peer | always on |
149//! | Deeply nested protobuf | Recursion limit in [`pbrs`] | always on |
150//! | Truncated or malformed frames | Rejected as a protocol error, never treated as an empty message | always on |
151//! | Reserved metadata injection | `grpc-*` and hop-by-hop headers are never read from or written to user metadata | always on |
152//! | Cleartext interception | TLS 1.2/1.3, ALPN `h2` required; built-in constructors configure certificate verification, caller configs retain their trusted application policy | opt-in [`Server::serve_tls`] / [`Channel::connect_tls`] |
153//! | Impersonation | WebPKI roots or a CA you pin; mTLS via [`ServerTls::mtls`]; verified client chain on [`Rpc::peer_identity`] | opt-in |
154//! | Unauthenticated Unix peer | Connecting process uid/gid/pid on [`Rpc::peer_cred`] from `SO_PEERCRED` / `LOCAL_PEERCRED` | Unix accept loop |
155//! | Long-lived connection hold | GOAWAY (server) or close (client) after age or idle; keepalive PINGs do not reset idle and do not postpone age | opt-in [`ServerConfig::max_connection_age`] / [`ServerConfig::max_connection_idle`] / [`ChannelConfig::max_connection_age`] / [`ChannelConfig::max_connection_idle`] |
156//! | Slow handshake | Whole client dial, and each of the server TLS accept and HTTP/2 preface, is timed out | 20 s ([`ChannelConfig::connect_timeout`] / [`ServerConfig::handshake_timeout`]) |
157//! | Accept storm | Drop excess TCP/Unix accepts before a handshake task is spawned | opt-in [`ServerConfig::max_concurrent_connections`] |
158//! | Unbounded handler concurrency | Refuse further RPCs with `RESOURCE_EXHAUSTED` before the handler runs | opt-in [`ServerConfig::max_concurrent_rpcs`] |
159//! | Unbounded client RPC concurrency | Refuse further RPCs with `RESOURCE_EXHAUSTED` before the stream opens | opt-in [`ChannelConfig::max_concurrent_rpcs`] |
160//! | Handler that never returns | Cap the RPC even when the client omits `grpc-timeout` | opt-in [`ServerConfig::timeout`] |
161//! | Silent TCP half-open | TCP `SO_KEEPALIVE` (not HTTP/2 PING) | opt-in [`ServerConfig::tcp_keepalive`] / [`ChannelConfig::tcp_keepalive`] |
162//! | HTTP/2 rapid reset | Cap remotely-reset streams waiting in the accept queue | 20 ([`DEFAULT_MAX_PENDING_ACCEPT_RESET_STREAMS`], override [`ServerConfig::max_pending_accept_reset_streams`]) |
163//! | HTTP/2 protocol-error RST flood | Cap locally-reset streams caused by invalid frames | 1024 ([`DEFAULT_MAX_LOCAL_ERROR_RESET_STREAMS`], override [`ServerConfig::max_local_error_reset_streams`]) |
164//! | HTTP/2 locally-reset stream memory | Remember stream IDs after we RST; oldest purged, not GOAWAY | 50 ([`DEFAULT_MAX_CONCURRENT_RESET_STREAMS`], override [`ServerConfig::max_concurrent_reset_streams`]) |
165//! | HTTP/2 small-DATA flood | Cap framing overhead of tiny DATA frames | 25600 ([`DEFAULT_DATA_FRAME_BUDGET`], override [`ServerConfig::data_frame_budget`]) |
166//! | HTTP/2 CONTINUATION flood | Cap CONTINUATION frames on an unfinished header block; that connection drops | always (`h2`, scaled from [`ServerConfig::max_header_list_size`]) |
167//! | Unfinished HEADERS | Header block without `END_HEADERS` stalls that stream only; the accept loop still serves | always |
168//! | Client RST after the request is read | Signal [`Request::cancelled`], then drop a still-pending handler; abort a stream drain waiting for the next message | always |
169//! | Client cancel after a client-streaming half-close | RST while the unary response is pending (handle, drop, or deadline) | always |
170//! | Client request-stream abort ([`StreamSender::fail`]) | RST CANCEL; the [`Call`] resolves with that status (client-streaming, or bidi before headers — not `UNAVAILABLE` from the reset); after bidi headers the received [`Streaming`] sees [`Code::Cancelled`], not that status | always |
171//! | Client streaming deadline | RST the send half before headers (server-streaming and bidi) and after a half-close; after those headers RST the parked send half | always |
172//! | Unsupported method or content type (GET, JSON, `grpc+json`) | HTTP 405 / 415 with no `grpc-status`, before an RPC slot is taken; supported gRPC-Web types are accepted with `grpc-web` and rejected with 415 without it | always |
173//!
174//! h2c (cleartext prior-knowledge HTTP/2) remains the default, because that is
175//! what a loopback test and a mesh sidecar speak. Production that is not
176//! behind a sidecar should call [`Server::serve_tls`] / [`Channel::connect_tls`].
177//! Built-in TLS constructors configure peer verification. Caller-owned rustls
178//! configs are trusted application inputs: custom verifier security and ticket
179//! invalidation belong to the caller. Disabling peer verification is unsupported.
180//!
181//! Set finite connection, RPC, message, and application queue limits for the
182//! deployment. HTTP/2 stream limits govern each connection;
183//! [`ServerConfig::max_concurrent_rpcs`] limits active handlers across the server
184//! and rejects excess calls with `RESOURCE_EXHAUSTED`.
185//!
186//! ## `unsafe`
187//!
188//! The hand-written gRPC framing, transport, TLS, compression,
189//! codec, resolver, load-balancing, authorization, binary-logging,
190//! service-config, metadata, status, request, response, and stream modules
191//! carry `#[forbid(unsafe_code)]`, which cannot be overridden from inside the
192//! module.
193//!
194//! Two hand-written Linux-only OS helpers use scoped `unsafe`, each with a
195//! local `SAFETY` comment:
196//!
197//! - `proxy` sets `TCP_USER_TIMEOUT` with a raw `setsockopt` because `socket2`
198//!   exposes no stable safe wrapper for that option.
199//! - `rt::per_core` calls `sched_setaffinity` / `sched_getcpu` to pin
200//!   per-core runtime threads.
201//!
202//! `server::rpc::InboundRpc::from_rpc` initializes a boxed call record field
203//! by field. `rpc_cancel::RpcCancel::drop` moves an initialized `Arc` out of
204//! `ManuallyDrop` exactly once. The embedded HTTP/2 backend uses a Linux
205//! futex mutex with guarded `UnsafeCell` access, plus upstream's validated
206//! `BytesStr::as_str` UTF-8 view. Other platforms use the standard mutex.
207//! Other scoped helpers store owned or static HTTP names and copy cached
208//! static HTTP values. Request extensions publish through `OnceLock` without
209//! unsafe code. These exceptions do not relax the transport seam's forbid.
210//!
211//! Modules that `include!` generated message code ([`hello`], [`testing`],
212//! [`health`], [`reflection`], [`pb`], [`channelz`], [`orca`]) are also outside
213//! those per-module forbids; `pbrs` gencode uses `unsafe` for zeroed-message
214//! construction, and that is a `pbrs` property rather than a gRPC transport
215//! one.
216//!
217//! Invalid peer input is handled through gRPC status or HTTP/2 protocol errors.
218//! Workspace lints restrict panics, unchecked indexing, and lossy casts in
219//! shipping code. Negative tests and fuzzing exercise these paths.
220//!
221//! # Tuning
222//!
223//! Configure connection count, HTTP/2 windows, and stream queues for the
224//! workload:
225//!
226//! 1. **[`ChannelConfig::connections`]** — one connection is one `h2` driver
227//!    task. A pool can distribute driver work across runtime workers.
228//! 2. **Window sizes** — the 16 MiB default keeps a 4 MiB message from
229//!    stalling on a `WINDOW_UPDATE` round trip. Lower it only under memory
230//!    pressure: [`Server::initial_stream_window_size`] /
231//!    [`ChannelConfig::initial_stream_window_size`].
232//! 3. **Stream queue depth** — the buffer a streaming handler passes to
233//!    [`Streaming::channel`], and [`Channel::stream_buffer`] /
234//!    [`ChannelConfig::stream_buffer`] on the client. The wire layer writes
235//!    whatever is queued as one batch, so deeper means fewer and larger writes
236//!    at the cost of memory. Received streams are decoded inline and have no
237//!    queue to size.
238//!
239//! Compression trades CPU for bandwidth. Enable it with
240//! [`Request::set_compress`], [`ServerConfig::send_compressed`], or
241//! [`ChannelConfig::send_compressed`]. The default gzip effort is 1; configure it
242//! with `gzip_compression_level`. Inbound compression is accepted by default
243//! and can be disabled with `accept_compressed`. [`Response::encoding`] reports
244//! the peer's selected encoding (`None` for identity).
245//!
246//! HTTP/2 windows are fixed unless adaptive flow control is explicitly enabled.
247//! Configure reset-stream retention and flood limits through [`ServerConfig`]
248//! and [`ChannelConfig`]. Client handshake settings take effect at connection
249//! creation; changing a live channel cannot renegotiate HTTP/2 SETTINGS.
250//!
251//! # Relationship to the rest of the workspace
252//!
253//! [`pbrs`] does not depend on this crate. The native transport runs without
254//! tonic; the optional `tonic` feature mounts native generated services
255//! in tonic. Use `protobuf-tonic` to keep a tonic service with pbrs messages.
256
257#![deny(unsafe_code)]
258#![deny(unsafe_op_in_unsafe_fn)]
259#![deny(rustdoc::broken_intra_doc_links)]
260#![allow(
261    clippy::needless_doctest_main,
262    reason = "the quickstart shows a real build.rs, which needs its main"
263)]
264
265// Generated stubs refer to this crate by name. Inside the crate itself that
266// name would not resolve without this alias.
267extern crate self as pbrs_grpc;
268
269// `forbid` on each hand-written module cannot be relaxed from inside it, so
270// the no-`unsafe` claim is machine-checked rather than a convention. Modules
271// that `include!` generated message code are excluded from `forbid`.
272#[forbid(unsafe_code)]
273pub mod codec;
274#[forbid(unsafe_code)]
275pub mod compat;
276#[forbid(unsafe_code)]
277pub mod compression;
278#[forbid(unsafe_code)]
279pub mod copy_counts;
280#[forbid(unsafe_code)]
281pub mod gzip;
282#[forbid(unsafe_code)]
283pub mod interop_cases;
284#[forbid(unsafe_code)]
285pub mod telemetry;
286#[forbid(unsafe_code)]
287pub mod timeout;
288#[cfg(feature = "grpc-web")]
289pub mod web;
290
291#[cfg(feature = "tonic")]
292pub mod tonic_server;
293#[cfg(feature = "tower")]
294pub mod tower_client;
295#[cfg(feature = "tower")]
296pub mod tower_server;
297
298pub mod channelz;
299pub mod health;
300pub mod hello;
301pub mod orca;
302#[cfg(feature = "otel")]
303pub mod otel;
304pub mod pb;
305pub mod reflection;
306pub mod testing;
307
308#[forbid(unsafe_code)]
309pub mod authz;
310#[forbid(unsafe_code)]
311mod bdp;
312#[forbid(unsafe_code)]
313pub mod binlog;
314#[forbid(unsafe_code)]
315mod client;
316
317mod config;
318#[forbid(unsafe_code)]
319mod executor;
320#[forbid(unsafe_code)]
321mod interceptor;
322#[forbid(unsafe_code)]
323mod keepalive;
324// Connect info is published once without mutating an exposed map.
325mod lazy_ext;
326// `PathAndQuery::from_static` clone is a virtual call that only copies words.
327mod static_copy;
328// The uncompressed gRPC prefix is five bytes in a buffer that was just reserved.
329mod grpc_prefix;
330#[forbid(unsafe_code)]
331pub mod lb;
332#[forbid(unsafe_code)]
333mod limits;
334#[forbid(unsafe_code)]
335mod metadata;
336mod proxy;
337#[forbid(unsafe_code)]
338mod request;
339#[forbid(unsafe_code)]
340pub mod resolver;
341mod rpc_cancel;
342// `rt::per_core` pins threads with one Linux affinity syscall; the rest of
343// the seam stays safe-only (see the forbid on `mod manual`).
344mod rt;
345// `InboundRpc::from_rpc` writes one call record into its allocation.
346// The rest of the server stays safe; `deny` lets that function opt in.
347#[deny(unsafe_code)]
348mod server;
349#[forbid(unsafe_code)]
350pub mod service_config;
351#[forbid(unsafe_code)]
352mod status;
353#[forbid(unsafe_code)]
354mod stream;
355#[forbid(unsafe_code)]
356mod tcp;
357#[forbid(unsafe_code)]
358mod tls;
359#[forbid(unsafe_code)]
360mod transport;
361// Modified embedded upstream backend. Its synchronization and UTF-8 views
362// have scoped unsafe invariants; the transport seam remains safe-only.
363#[rustfmt::skip]
364mod h2_backend;
365
366/// Runs the bounded receive-codec driver for cargo-fuzz; absent from normal builds.
367#[cfg(fuzzing)]
368#[doc(hidden)]
369pub fn __fuzz_h2_frames(data: &[u8]) {
370    h2_backend::fuzz_bridge::fuzz_h2_frames(data);
371}
372
373#[forbid(unsafe_code)]
374mod wire;
375#[forbid(unsafe_code)]
376mod workspace;
377
378/// Re-exports that `protoc-gen-pbrs` stubs name explicitly.
379///
380/// Generated code must not assume the surrounding crate depends on `tokio` by
381/// that name, so it reaches for these instead. Not a stable API.
382#[doc(hidden)]
383#[forbid(unsafe_code)]
384pub mod codegen_support {
385    pub use tokio::io::{AsyncRead, AsyncWrite};
386    pub use tokio::net::TcpListener;
387    #[cfg(unix)]
388    pub use tokio::net::UnixListener;
389}
390
391pub use client::{Channel, Endpoint, RetryStats, Target};
392pub use codec::CodecMessage;
393pub use compression::{Codec, CompressionAlgorithm};
394pub use config::{
395    ChannelConfig, DEFAULT_ADAPTIVE_WINDOW_INITIAL_SIZE, DEFAULT_ADAPTIVE_WINDOW_MAX_SIZE,
396    DEFAULT_CONNECT_TIMEOUT, DEFAULT_DATA_FRAME_BUDGET, DEFAULT_GZIP_COMPRESSION_LEVEL,
397    DEFAULT_HEADER_TABLE_SIZE, DEFAULT_KEEP_ALIVE_TIMEOUT, DEFAULT_MAX_CONCURRENT_RESET_STREAMS,
398    DEFAULT_MAX_CONCURRENT_STREAMS, DEFAULT_MAX_CONNECTION_AGE_GRACE, DEFAULT_MAX_FRAME_SIZE,
399    DEFAULT_MAX_HEADER_LIST_SIZE, DEFAULT_MAX_LOCAL_ERROR_RESET_STREAMS,
400    DEFAULT_MAX_PENDING_ACCEPT_RESET_STREAMS, DEFAULT_MAX_SEND_BUFFER_SIZE,
401    DEFAULT_RESET_STREAM_DURATION, DEFAULT_STREAM_BUFFER, DEFAULT_WINDOW_SIZE, ServerConfig,
402};
403pub use copy_counts::{CopyCounts, copy_counts, reset_copy_counts};
404#[cfg(feature = "copy-counts")]
405pub use copy_counts::{SchedulerCounts, reset_scheduler_counts, scheduler_counts};
406pub use executor::{Executor, ExecutorFuture};
407/// `futures_core::Stream`, so [`Streaming`] can be driven with `StreamExt`.
408pub use futures_core::Stream;
409/// `futures_core::future::FusedFuture`, so a finished [`Call`] is skipped by
410/// combinators that honour termination.
411pub use futures_core::future::FusedFuture;
412/// `futures_core::stream::FusedStream`, so a finished [`Streaming`] is skipped by
413/// combinators that honour termination.
414pub use futures_core::stream::FusedStream;
415/// Per-RPC typed bag: insert in an interceptor, read in the handler.
416pub use http::Extensions;
417pub use interceptor::{
418    ClientInterceptor, Intercepted, Interceptor, ResponseInterceptor, ServiceExt,
419};
420pub use limits::{ByteBudgetTracker, BytePermit, DEFAULT_MAX_DECODING_MESSAGE_SIZE, MessageLimits};
421pub use metadata::Metadata;
422pub use pb::{Any, ErrorDetails};
423#[cfg(unix)]
424pub use request::UdsConnectInfo;
425pub use request::{
426    Call, CallHandle, Outgoing, Parts, Request, Response, ResponseParts, TcpConnectInfo,
427    TlsConnectInfo,
428};
429pub use server::{
430    ConnectionInfo, Incoming, IncomingAccept, PeerCred, Router, Rpc, Server, Service,
431};
432pub use service_config::{
433    HedgingPolicy, LbPolicyConfig, MethodConfig, MethodName, RetryPolicy, RetryThrottler,
434    RetryThrottling, RingHashConfig, ServiceConfig, WeightedRoundRobinConfig, pushback_delay,
435    retry_backoff,
436};
437pub use status::{Code, ParseCodeError, Pushback, Status};
438pub use stream::{Framed, StreamSender, Streaming};
439pub use telemetry::{
440    AttemptLabels, BoundedMetricObserver, CallLabels, CallRole, CancellationEvent,
441    CancellationReason, LifecycleObserver, MAX_METRIC_LABEL_BYTES, MAX_METRIC_RPCS,
442    MAX_METRIC_TARGETS, MetricAttemptClass, MetricCallLabels, MetricEvent, MetricLabelPolicy,
443    MetricSink, OTHER_METRIC_LABEL, ObserverChain, OwnedCallLabels, ReconnectEvent, RejectionEvent,
444    RejectionReason,
445};
446pub use tls::{
447    ClientTls, Identity, PeerIdentity, ServerTls, TcpStats, TlsHandshakeInfo,
448    post_quantum_key_exchange_available,
449};
450
451pub use hello::{Greeter, GreeterClient, GreeterServer, HelloReply, HelloRequest};
452pub use interop_cases::run_case;
453pub use testing::{
454    BoolValue, EchoStatus, Empty, InteropTestService, Payload, ResponseParameters, SimpleRequest,
455    SimpleResponse, SizedInteropTestService, StreamingInputCallRequest, StreamingInputCallResponse,
456    StreamingOutputCallRequest, StreamingOutputCallResponse, TestService, TestServiceClient,
457    TestServiceServer,
458};