From c9c17c76401fdfc47f975d79ec159af6c8ad23cf Mon Sep 17 00:00:00 2001 From: Amr Hassan Date: Fri, 31 Jan 2025 16:37:31 +0100 Subject: [PATCH 01/61] Add From for Response (#1064) Co-authored-by: tottoto --- tonic/src/response.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tonic/src/response.rs b/tonic/src/response.rs index e22e25eaf..99272b8b1 100644 --- a/tonic/src/response.rs +++ b/tonic/src/response.rs @@ -127,6 +127,12 @@ impl Response { } } +impl From for Response { + fn from(inner: T) -> Self { + Response::new(inner) + } +} + #[cfg(test)] mod tests { use super::*; From f4bc1fd1d5ed14223fd746e264acd0d07fa91c17 Mon Sep 17 00:00:00 2001 From: tottoto Date: Sat, 1 Feb 2025 01:11:17 +0900 Subject: [PATCH 02/61] chore: Add getrandom and wasi crate to cargo-deny skip config (#2169) --- deny.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deny.toml b/deny.toml index 6bc5a3a66..8fc479b93 100644 --- a/deny.toml +++ b/deny.toml @@ -19,6 +19,8 @@ deny = [ { crate = "term" }, ] skip = [ + { crate = "getrandom@0.2.15", reason = "quickcheck depends on rand which depends on it" }, + { crate = "wasi@0.11.0+wasi-snapshot-preview1", reason = "quickcheck depends on rand which depends on it" }, { crate = "itertools@0.12.1", reason = "aws-lc-sys depends on bindgen which depends on it" }, { crate = "unicode-width@0.1.14", reason = "protox depends on miette wich depends on it" }, ] From f07abb270df998410bd2bb30f5b3711697763f62 Mon Sep 17 00:00:00 2001 From: tottoto Date: Sat, 1 Feb 2025 01:22:02 +0900 Subject: [PATCH 03/61] chore(examples): Update to rand 0.9 (#2168) --- examples/Cargo.toml | 2 +- examples/routeguide-tutorial.md | 8 ++++---- examples/src/routeguide/client.rs | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 78f47c4e2..0b868776c 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -285,7 +285,7 @@ async-stream = { version = "0.3", optional = true } tokio-stream = { version = "0.1", optional = true } tokio-util = { version = "0.7.8", optional = true } tower = { version = "0.5", optional = true } -rand = { version = "0.8", optional = true } +rand = { version = "0.9", optional = true } serde = { version = "1.0", features = ["derive"], optional = true } serde_json = { version = "1.0", optional = true } tracing = { version = "0.1.16", optional = true } diff --git a/examples/routeguide-tutorial.md b/examples/routeguide-tutorial.md index d002cff08..c434ff8b7 100644 --- a/examples/routeguide-tutorial.md +++ b/examples/routeguide-tutorial.md @@ -693,8 +693,8 @@ use rand::Rng; ```rust async fn run_record_route(client: &mut RouteGuideClient) -> Result<(), Box> { - let mut rng = rand::thread_rng(); - let point_count: i32 = rng.gen_range(2..100); + let mut rng = rand::rng(); + let point_count: i32 = rng.random_range(2..100); let mut points = vec![]; for _ in 0..=point_count { @@ -715,8 +715,8 @@ async fn run_record_route(client: &mut RouteGuideClient) -> Result<(), ```rust fn random_point(rng: &mut ThreadRng) -> Point { - let latitude = (rng.gen_range(0..180) - 90) * 10_000_000; - let longitude = (rng.gen_range(0..360) - 180) * 10_000_000; + let latitude = (rng.random_range(0..180) - 90) * 10_000_000; + let longitude = (rng.random_range(0..360) - 180) * 10_000_000; Point { latitude, longitude, diff --git a/examples/src/routeguide/client.rs b/examples/src/routeguide/client.rs index db61e1c39..9de1477e6 100644 --- a/examples/src/routeguide/client.rs +++ b/examples/src/routeguide/client.rs @@ -39,8 +39,8 @@ async fn print_features(client: &mut RouteGuideClient) -> Result<(), Bo } async fn run_record_route(client: &mut RouteGuideClient) -> Result<(), Box> { - let mut rng = rand::thread_rng(); - let point_count: i32 = rng.gen_range(2..100); + let mut rng = rand::rng(); + let point_count: i32 = rng.random_range(2..100); let mut points = vec![]; for _ in 0..=point_count { @@ -115,8 +115,8 @@ async fn main() -> Result<(), Box> { } fn random_point(rng: &mut ThreadRng) -> Point { - let latitude = (rng.gen_range(0..180) - 90) * 10_000_000; - let longitude = (rng.gen_range(0..360) - 180) * 10_000_000; + let latitude = (rng.random_range(0..180) - 90) * 10_000_000; + let longitude = (rng.random_range(0..360) - 180) * 10_000_000; Point { latitude, longitude, From 78be69e92f297929d8f711d1927e4bdda8c324da Mon Sep 17 00:00:00 2001 From: tottoto Date: Sat, 1 Feb 2025 01:23:03 +0900 Subject: [PATCH 04/61] chore(interop): Replace repeat and take with repeat_n (#2170) --- interop/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interop/src/lib.rs b/interop/src/lib.rs index a2bfc337e..961e0fdf7 100644 --- a/interop/src/lib.rs +++ b/interop/src/lib.rs @@ -18,14 +18,14 @@ pub fn trace_init() { pub fn client_payload(size: usize) -> pb::Payload { pb::Payload { r#type: default::Default::default(), - body: iter::repeat(0u8).take(size).collect(), + body: iter::repeat_n(0u8, size).collect(), } } pub fn server_payload(size: usize) -> pb::Payload { pb::Payload { r#type: default::Default::default(), - body: iter::repeat(0u8).take(size).collect(), + body: iter::repeat_n(0u8, size).collect(), } } From a2769c4d1940789489164c5a653b1e938a352c90 Mon Sep 17 00:00:00 2001 From: Maxim Evtush <154841002+maximevtush@users.noreply.github.com> Date: Tue, 11 Feb 2025 01:46:15 +0100 Subject: [PATCH 05/61] Update LICENSE (#2167) --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 307709840..c7f571db6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020 Lucio Franco +Copyright (c) 2025 Lucio Franco Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 1a7a61d86cc8a43a6383eae4570c1fd2920b110f Mon Sep 17 00:00:00 2001 From: tottoto Date: Tue, 11 Feb 2025 10:31:55 +0900 Subject: [PATCH 06/61] chore(transport): Update url to http crate document (#2173) --- tonic/src/transport/service/grpc_timeout.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tonic/src/transport/service/grpc_timeout.rs b/tonic/src/transport/service/grpc_timeout.rs index 019a37a2f..5285d205f 100644 --- a/tonic/src/transport/service/grpc_timeout.rs +++ b/tonic/src/transport/service/grpc_timeout.rs @@ -113,7 +113,7 @@ fn try_parse_grpc_timeout( .and_then(|s| if s.is_empty() { Err(val) } else { Ok(s) })? // `HeaderValue::to_str` only returns `Ok` if the header contains ASCII so this // `split_at` will never panic from trying to split in the middle of a character. - // See https://docs.rs/http/0.2.4/http/header/struct.HeaderValue.html#method.to_str + // See https://docs.rs/http/1/http/header/struct.HeaderValue.html#method.to_str // // `len - 1` also wont panic since we just checked `s.is_empty`. .split_at(val.len() - 1); From 766fa858ffd2d689af8cce253b1d4acea372d614 Mon Sep 17 00:00:00 2001 From: tottoto Date: Tue, 11 Feb 2025 10:32:08 +0900 Subject: [PATCH 07/61] chore: Refactor redundant pattern match (#2174) --- tonic/src/codec/decode.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tonic/src/codec/decode.rs b/tonic/src/codec/decode.rs index deca326ef..1e6876fc8 100644 --- a/tonic/src/codec/decode.rs +++ b/tonic/src/codec/decode.rs @@ -399,9 +399,8 @@ impl Stream for Streaming { return Poll::Ready(Some(Ok(item))); } - match ready!(self.inner.poll_frame(cx))? { - Some(()) => (), - None => break, + if ready!(self.inner.poll_frame(cx))?.is_none() { + break; } } From 2b7e2c3eaaea6da4c628dbb5112aa262ead7b6e8 Mon Sep 17 00:00:00 2001 From: tottoto Date: Tue, 11 Feb 2025 10:32:27 +0900 Subject: [PATCH 08/61] chore(transport): Remove redundant type reconstruct (#2176) --- tonic/src/transport/service/grpc_timeout.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tonic/src/transport/service/grpc_timeout.rs b/tonic/src/transport/service/grpc_timeout.rs index 5285d205f..0465b0269 100644 --- a/tonic/src/transport/service/grpc_timeout.rs +++ b/tonic/src/transport/service/grpc_timeout.rs @@ -80,8 +80,8 @@ where fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let this = self.project(); - if let Poll::Ready(result) = this.inner.poll(cx) { - return Poll::Ready(result.map_err(Into::into)); + if let ready @ Poll::Ready(_) = this.inner.poll(cx) { + return ready.map_err(Into::into); } if let Some(sleep) = this.sleep.as_pin_mut() { From fc940ce158513d5d989772c571a34ee5f6f43292 Mon Sep 17 00:00:00 2001 From: tottoto Date: Tue, 11 Feb 2025 10:32:46 +0900 Subject: [PATCH 09/61] chore: Update to strum 0.27 (#2180) --- interop/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interop/Cargo.toml b/interop/Cargo.toml index e460f2f55..875de7d50 100644 --- a/interop/Cargo.toml +++ b/interop/Cargo.toml @@ -14,7 +14,7 @@ path = "src/bin/server.rs" [dependencies] async-stream = "0.3" -strum = {version = "0.26", features = ["derive"]} +strum = {version = "0.27", features = ["derive"]} pico-args = {version = "0.5", features = ["eq-separator"]} console = "0.15" http = "1" From 77cee9c575de381df1866b8a8b68f764116e2487 Mon Sep 17 00:00:00 2001 From: Marco Neumann Date: Sat, 1 Mar 2025 02:54:04 +0100 Subject: [PATCH 10/61] feat: optional `SSLKEYLOGFILE` support (#1539) Add a `use_key_log` option to server and client TLS configs that -- when set -- will enable rustls's `SSLKEYLOGFILE` handling. This is helpful when you want to intercept TLS traffic for debugging and is generally supported by many libraries and browsers. Also see: https://wiki.wireshark.org/TLS#using-the-pre-master-secret --- tonic/src/transport/channel/service/tls.rs | 6 ++++++ tonic/src/transport/channel/tls.rs | 10 ++++++++++ tonic/src/transport/server/service/tls.rs | 5 +++++ tonic/src/transport/server/tls.rs | 10 ++++++++++ 4 files changed, 31 insertions(+) diff --git a/tonic/src/transport/channel/service/tls.rs b/tonic/src/transport/channel/service/tls.rs index 386cc8a6c..7510099a1 100644 --- a/tonic/src/transport/channel/service/tls.rs +++ b/tonic/src/transport/channel/service/tls.rs @@ -26,12 +26,14 @@ pub(crate) struct TlsConnector { } impl TlsConnector { + #[allow(clippy::too_many_arguments)] pub(crate) fn new( ca_certs: Vec, trust_anchors: Vec>, identity: Option, domain: &str, assume_http2: bool, + use_key_log: bool, #[cfg(feature = "tls-native-roots")] with_native_roots: bool, #[cfg(feature = "tls-webpki-roots")] with_webpki_roots: bool, ) -> Result { @@ -87,6 +89,10 @@ impl TlsConnector { None => builder.with_no_client_auth(), }; + if use_key_log { + config.key_log = Arc::new(tokio_rustls::rustls::KeyLogFile::new()); + } + config.alpn_protocols.push(ALPN_H2.into()); Ok(Self { config: Arc::new(config), diff --git a/tonic/src/transport/channel/tls.rs b/tonic/src/transport/channel/tls.rs index 0c2eb37e0..945384fd2 100644 --- a/tonic/src/transport/channel/tls.rs +++ b/tonic/src/transport/channel/tls.rs @@ -18,6 +18,7 @@ pub struct ClientTlsConfig { with_native_roots: bool, #[cfg(feature = "tls-webpki-roots")] with_webpki_roots: bool, + use_key_log: bool, } impl ClientTlsConfig { @@ -84,6 +85,14 @@ impl ClientTlsConfig { } } + /// Use key log as specified by the `SSLKEYLOGFILE` environment variable. + pub fn use_key_log(self) -> Self { + ClientTlsConfig { + use_key_log: true, + ..self + } + } + /// Enables the platform's trusted certs. #[cfg(feature = "tls-native-roots")] pub fn with_native_roots(self) -> Self { @@ -123,6 +132,7 @@ impl ClientTlsConfig { self.identity, domain, self.assume_http2, + self.use_key_log, #[cfg(feature = "tls-native-roots")] self.with_native_roots, #[cfg(feature = "tls-webpki-roots")] diff --git a/tonic/src/transport/server/service/tls.rs b/tonic/src/transport/server/service/tls.rs index 0a24d9482..42c376249 100644 --- a/tonic/src/transport/server/service/tls.rs +++ b/tonic/src/transport/server/service/tls.rs @@ -23,6 +23,7 @@ impl TlsAcceptor { client_ca_root: Option<&Certificate>, client_auth_optional: bool, ignore_client_order: bool, + use_key_log: bool, ) -> Result { let builder = ServerConfig::builder(); @@ -45,6 +46,10 @@ impl TlsAcceptor { let mut config = builder.with_single_cert(cert, key)?; config.ignore_client_order = ignore_client_order; + if use_key_log { + config.key_log = Arc::new(tokio_rustls::rustls::KeyLogFile::new()); + } + config.alpn_protocols.push(ALPN_H2.into()); Ok(Self { inner: Arc::new(config), diff --git a/tonic/src/transport/server/tls.rs b/tonic/src/transport/server/tls.rs index 92da18347..2e1ef8213 100644 --- a/tonic/src/transport/server/tls.rs +++ b/tonic/src/transport/server/tls.rs @@ -10,6 +10,7 @@ pub struct ServerTlsConfig { client_ca_root: Option, client_auth_optional: bool, ignore_client_order: bool, + use_key_log: bool, } impl fmt::Debug for ServerTlsConfig { @@ -64,12 +65,21 @@ impl ServerTlsConfig { } } + /// Use key log as specified by the `SSLKEYLOGFILE` environment variable. + pub fn use_key_log(self) -> Self { + ServerTlsConfig { + use_key_log: true, + ..self + } + } + pub(crate) fn tls_acceptor(&self) -> Result { TlsAcceptor::new( self.identity.as_ref().unwrap(), self.client_ca_root.as_ref(), self.client_auth_optional, self.ignore_client_order, + self.use_key_log, ) } } From 8ee85fc402ec0f757cd34a89812ff64b0311b41c Mon Sep 17 00:00:00 2001 From: tottoto Date: Sat, 1 Mar 2025 11:33:31 +0900 Subject: [PATCH 11/61] chore: Remove html_root_url (#2184) --- prepare-release.sh | 4 ---- tonic-build/src/lib.rs | 1 - tonic-health/src/lib.rs | 1 - tonic-reflection/src/lib.rs | 1 - tonic-types/src/lib.rs | 1 - tonic-web/src/lib.rs | 1 - tonic/Cargo.toml | 1 - tonic/src/lib.rs | 1 - 8 files changed, 11 deletions(-) diff --git a/prepare-release.sh b/prepare-release.sh index 9bae880f8..3e6caa34b 100755 --- a/prepare-release.sh +++ b/prepare-release.sh @@ -33,10 +33,6 @@ CRATES=( \ ) for CRATE in "${CRATES[@]}"; do - # Update html_root_url attributes. - sed -i -E "s~html_root_url = \"https://docs\.rs/${TONIC_CRATE_MATCHER}/$VERSION_MATCHER\"~html_root_url = \"https://docs.rs/\1/${VERSION}\"~" \ - "$DIR/$CRATE/src/lib.rs" - # Update documentation url in Cargo.toml sed -i -E "s~documentation = \"https://docs\.rs/$CRATE/$VERSION_MATCHER\"~documentation = \"https://docs.rs/${CRATE}/${VERSION}\"~" \ "$DIR/$CRATE/Cargo.toml" diff --git a/tonic-build/src/lib.rs b/tonic-build/src/lib.rs index 2aaf80983..2ba5b08ce 100644 --- a/tonic-build/src/lib.rs +++ b/tonic-build/src/lib.rs @@ -64,7 +64,6 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg" )] -#![doc(html_root_url = "https://docs.rs/tonic-build/0.13.0")] #![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")] #![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))] #![cfg_attr(docsrs, feature(doc_auto_cfg))] diff --git a/tonic-health/src/lib.rs b/tonic-health/src/lib.rs index 365b17752..5884fd82d 100644 --- a/tonic-health/src/lib.rs +++ b/tonic-health/src/lib.rs @@ -9,7 +9,6 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg" )] -#![doc(html_root_url = "https://docs.rs/tonic-health/0.13.0")] #![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")] #![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))] #![cfg_attr(docsrs, feature(doc_auto_cfg))] diff --git a/tonic-reflection/src/lib.rs b/tonic-reflection/src/lib.rs index 94a428817..97ea31653 100644 --- a/tonic-reflection/src/lib.rs +++ b/tonic-reflection/src/lib.rs @@ -3,7 +3,6 @@ #![doc( html_logo_url = "https://github.com/hyperium/tonic/raw/master/.github/assets/tonic-docs.png" )] -#![doc(html_root_url = "https://docs.rs/tonic-reflection/0.13.0")] #![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")] #![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))] #![cfg_attr(docsrs, feature(doc_auto_cfg))] diff --git a/tonic-types/src/lib.rs b/tonic-types/src/lib.rs index b30b8ed32..c70079b9a 100644 --- a/tonic-types/src/lib.rs +++ b/tonic-types/src/lib.rs @@ -143,7 +143,6 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg" )] -#![doc(html_root_url = "https://docs.rs/tonic-types/0.13.0")] #![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")] mod generated { diff --git a/tonic-web/src/lib.rs b/tonic-web/src/lib.rs index e7a48c877..b8473f579 100644 --- a/tonic-web/src/lib.rs +++ b/tonic-web/src/lib.rs @@ -68,7 +68,6 @@ //! [`tonic_web`]: https://github.com/hyperium/tonic //! [grpc-web]: https://github.com/grpc/grpc-web //! [tower]: https://github.com/tower-rs/tower -#![doc(html_root_url = "https://docs.rs/tonic-web/0.13.0")] #![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")] pub use call::GrpcWebCall; diff --git a/tonic/Cargo.toml b/tonic/Cargo.toml index 33fe76af1..eee2c3f73 100644 --- a/tonic/Cargo.toml +++ b/tonic/Cargo.toml @@ -2,7 +2,6 @@ name = "tonic" # When releasing to crates.io: # - Remove path dependencies -# - Update html_root_url. # - Update doc url # - Cargo.toml # - README.md diff --git a/tonic/src/lib.rs b/tonic/src/lib.rs index 3dcbd2108..4bcb80d00 100644 --- a/tonic/src/lib.rs +++ b/tonic/src/lib.rs @@ -91,7 +91,6 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg" )] -#![doc(html_root_url = "https://docs.rs/tonic/0.13.0")] #![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")] #![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))] #![cfg_attr(docsrs, feature(doc_auto_cfg))] From 72b0fd59442d71804d4104e313ef6f140ab8f6d1 Mon Sep 17 00:00:00 2001 From: tottoto Date: Sat, 1 Mar 2025 11:33:46 +0900 Subject: [PATCH 12/61] chore: Remove unused mutability (#2183) --- tonic-web/src/call.rs | 8 ++++---- tonic-web/src/service.rs | 4 ++-- tonic/src/transport/server/io_stream.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tonic-web/src/call.rs b/tonic-web/src/call.rs index 3e8952b9f..90cfafca9 100644 --- a/tonic-web/src/call.rs +++ b/tonic-web/src/call.rs @@ -177,9 +177,9 @@ where return Poll::Ready(Some(Ok(Frame::data(bytes)))); } - let mut this = self.as_mut().project(); + let this = self.as_mut().project(); - match ready!(this.inner.as_mut().poll_frame(cx)) { + match ready!(this.inner.poll_frame(cx)) { Some(Ok(frame)) if frame.is_data() => this .buf .put(frame.into_data().unwrap_or_else(|_| unreachable!())), @@ -217,9 +217,9 @@ where mut self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll, Status>>> { - let mut this = self.as_mut().project(); + let this = self.as_mut().project(); - match ready!(this.inner.as_mut().poll_frame(cx)) { + match ready!(this.inner.poll_frame(cx)) { Some(Ok(frame)) if frame.is_data() => { let mut data = frame.into_data().unwrap_or_else(|_| unreachable!()); let mut res = data.copy_to_bytes(data.remaining()); diff --git a/tonic-web/src/service.rs b/tonic-web/src/service.rs index e43223a36..a60a724ba 100644 --- a/tonic-web/src/service.rs +++ b/tonic-web/src/service.rs @@ -159,9 +159,9 @@ where type Output = Result, E>; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - let mut this = self.project(); + let this = self.project(); - match this.case.as_mut().project() { + match this.case.project() { CaseProj::GrpcWeb { future, accept } => { let res = ready!(future.poll(cx))?; diff --git a/tonic/src/transport/server/io_stream.rs b/tonic/src/transport/server/io_stream.rs index 222970935..a0fbf83df 100644 --- a/tonic/src/transport/server/io_stream.rs +++ b/tonic/src/transport/server/io_stream.rs @@ -52,7 +52,7 @@ where where IE: Into, { - match ready!(self.as_mut().project().inner.as_mut().poll_next(cx)) { + match ready!(self.as_mut().project().inner.poll_next(cx)) { Some(Ok(io)) => Poll::Ready(Some(Ok(ServerIo::new_io(io)))), Some(Err(e)) => match handle_tcp_accept_error(e) { ControlFlow::Continue(()) => { From 476cb38ac511cf1e2f6a351a5d45ef0c38a57fb7 Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 24 Mar 2025 22:28:29 +0900 Subject: [PATCH 13/61] chore: Update generated code (#2222) --- .../src/generated/grpc_health_v1_fds.rs | 588 +--- .../src/generated/reflection_v1_fds.rs | 1868 +------------ .../src/generated/reflection_v1alpha1_fds.rs | 1816 +------------ tonic-types/src/generated/types_fds.rs | 2377 ++--------------- 4 files changed, 486 insertions(+), 6163 deletions(-) diff --git a/tonic-health/src/generated/grpc_health_v1_fds.rs b/tonic-health/src/generated/grpc_health_v1_fds.rs index 942bb3099..38df98031 100644 --- a/tonic-health/src/generated/grpc_health_v1_fds.rs +++ b/tonic-health/src/generated/grpc_health_v1_fds.rs @@ -1,549 +1,47 @@ // This file is @generated by codegen. /// Byte encoded FILE_DESCRIPTOR_SET. pub const FILE_DESCRIPTOR_SET: &[u8] = &[ - 10u8, - 158u8, - 4u8, - 10u8, - 12u8, - 104u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 18u8, - 14u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 104u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 46u8, - 118u8, - 49u8, - 34u8, - 46u8, - 10u8, - 18u8, - 72u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 67u8, - 104u8, - 101u8, - 99u8, - 107u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 18u8, - 24u8, - 10u8, - 7u8, - 115u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 7u8, - 115u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 34u8, - 177u8, - 1u8, - 10u8, - 19u8, - 72u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 67u8, - 104u8, - 101u8, - 99u8, - 107u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 73u8, - 10u8, - 6u8, - 115u8, - 116u8, - 97u8, - 116u8, - 117u8, - 115u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 14u8, - 50u8, - 49u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 104u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 46u8, - 118u8, - 49u8, - 46u8, - 72u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 67u8, - 104u8, - 101u8, - 99u8, - 107u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 46u8, - 83u8, - 101u8, - 114u8, - 118u8, - 105u8, - 110u8, - 103u8, - 83u8, - 116u8, - 97u8, - 116u8, - 117u8, - 115u8, - 82u8, - 6u8, - 115u8, - 116u8, - 97u8, - 116u8, - 117u8, - 115u8, - 34u8, - 79u8, - 10u8, - 13u8, - 83u8, - 101u8, - 114u8, - 118u8, - 105u8, - 110u8, - 103u8, - 83u8, - 116u8, - 97u8, - 116u8, - 117u8, - 115u8, - 18u8, - 11u8, - 10u8, - 7u8, - 85u8, - 78u8, - 75u8, - 78u8, - 79u8, - 87u8, - 78u8, - 16u8, - 0u8, - 18u8, - 11u8, - 10u8, - 7u8, - 83u8, - 69u8, - 82u8, - 86u8, - 73u8, - 78u8, - 71u8, - 16u8, - 1u8, - 18u8, - 15u8, - 10u8, - 11u8, - 78u8, - 79u8, - 84u8, - 95u8, - 83u8, - 69u8, - 82u8, - 86u8, - 73u8, - 78u8, - 71u8, - 16u8, - 2u8, - 18u8, - 19u8, - 10u8, - 15u8, - 83u8, - 69u8, - 82u8, - 86u8, - 73u8, - 67u8, - 69u8, - 95u8, - 85u8, - 78u8, - 75u8, - 78u8, - 79u8, - 87u8, - 78u8, - 16u8, - 3u8, - 50u8, - 174u8, - 1u8, - 10u8, - 6u8, - 72u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 18u8, - 80u8, - 10u8, - 5u8, - 67u8, - 104u8, - 101u8, - 99u8, - 107u8, - 18u8, - 34u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 104u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 46u8, - 118u8, - 49u8, - 46u8, - 72u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 67u8, - 104u8, - 101u8, - 99u8, - 107u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 26u8, - 35u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 104u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 46u8, - 118u8, - 49u8, - 46u8, - 72u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 67u8, - 104u8, - 101u8, - 99u8, - 107u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 82u8, - 10u8, - 5u8, - 87u8, - 97u8, - 116u8, - 99u8, - 104u8, - 18u8, - 34u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 104u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 46u8, - 118u8, - 49u8, - 46u8, - 72u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 67u8, - 104u8, - 101u8, - 99u8, - 107u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 26u8, - 35u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 104u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 46u8, - 118u8, - 49u8, - 46u8, - 72u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 67u8, - 104u8, - 101u8, - 99u8, - 107u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 48u8, - 1u8, - 66u8, - 97u8, - 10u8, - 17u8, - 105u8, - 111u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 104u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 46u8, - 118u8, - 49u8, - 66u8, - 11u8, - 72u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 80u8, - 114u8, - 111u8, - 116u8, - 111u8, - 80u8, - 1u8, - 90u8, - 44u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 103u8, - 111u8, - 108u8, - 97u8, - 110u8, - 103u8, - 46u8, - 111u8, - 114u8, - 103u8, - 47u8, - 103u8, - 114u8, - 112u8, - 99u8, - 47u8, - 104u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 47u8, - 103u8, - 114u8, - 112u8, - 99u8, - 95u8, - 104u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 95u8, - 118u8, - 49u8, - 170u8, - 2u8, - 14u8, - 71u8, - 114u8, - 112u8, - 99u8, - 46u8, - 72u8, - 101u8, - 97u8, - 108u8, - 116u8, - 104u8, - 46u8, - 86u8, - 49u8, - 98u8, - 6u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 51u8, + 10u8, 158u8, 4u8, 10u8, 12u8, 104u8, 101u8, 97u8, 108u8, 116u8, 104u8, 46u8, 112u8, + 114u8, 111u8, 116u8, 111u8, 18u8, 14u8, 103u8, 114u8, 112u8, 99u8, 46u8, 104u8, + 101u8, 97u8, 108u8, 116u8, 104u8, 46u8, 118u8, 49u8, 34u8, 46u8, 10u8, 18u8, 72u8, + 101u8, 97u8, 108u8, 116u8, 104u8, 67u8, 104u8, 101u8, 99u8, 107u8, 82u8, 101u8, + 113u8, 117u8, 101u8, 115u8, 116u8, 18u8, 24u8, 10u8, 7u8, 115u8, 101u8, 114u8, 118u8, + 105u8, 99u8, 101u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, 7u8, 115u8, 101u8, 114u8, + 118u8, 105u8, 99u8, 101u8, 34u8, 177u8, 1u8, 10u8, 19u8, 72u8, 101u8, 97u8, 108u8, + 116u8, 104u8, 67u8, 104u8, 101u8, 99u8, 107u8, 82u8, 101u8, 115u8, 112u8, 111u8, + 110u8, 115u8, 101u8, 18u8, 73u8, 10u8, 6u8, 115u8, 116u8, 97u8, 116u8, 117u8, 115u8, + 24u8, 1u8, 32u8, 1u8, 40u8, 14u8, 50u8, 49u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, + 104u8, 101u8, 97u8, 108u8, 116u8, 104u8, 46u8, 118u8, 49u8, 46u8, 72u8, 101u8, 97u8, + 108u8, 116u8, 104u8, 67u8, 104u8, 101u8, 99u8, 107u8, 82u8, 101u8, 115u8, 112u8, + 111u8, 110u8, 115u8, 101u8, 46u8, 83u8, 101u8, 114u8, 118u8, 105u8, 110u8, 103u8, + 83u8, 116u8, 97u8, 116u8, 117u8, 115u8, 82u8, 6u8, 115u8, 116u8, 97u8, 116u8, 117u8, + 115u8, 34u8, 79u8, 10u8, 13u8, 83u8, 101u8, 114u8, 118u8, 105u8, 110u8, 103u8, 83u8, + 116u8, 97u8, 116u8, 117u8, 115u8, 18u8, 11u8, 10u8, 7u8, 85u8, 78u8, 75u8, 78u8, + 79u8, 87u8, 78u8, 16u8, 0u8, 18u8, 11u8, 10u8, 7u8, 83u8, 69u8, 82u8, 86u8, 73u8, + 78u8, 71u8, 16u8, 1u8, 18u8, 15u8, 10u8, 11u8, 78u8, 79u8, 84u8, 95u8, 83u8, 69u8, + 82u8, 86u8, 73u8, 78u8, 71u8, 16u8, 2u8, 18u8, 19u8, 10u8, 15u8, 83u8, 69u8, 82u8, + 86u8, 73u8, 67u8, 69u8, 95u8, 85u8, 78u8, 75u8, 78u8, 79u8, 87u8, 78u8, 16u8, 3u8, + 50u8, 174u8, 1u8, 10u8, 6u8, 72u8, 101u8, 97u8, 108u8, 116u8, 104u8, 18u8, 80u8, + 10u8, 5u8, 67u8, 104u8, 101u8, 99u8, 107u8, 18u8, 34u8, 46u8, 103u8, 114u8, 112u8, + 99u8, 46u8, 104u8, 101u8, 97u8, 108u8, 116u8, 104u8, 46u8, 118u8, 49u8, 46u8, 72u8, + 101u8, 97u8, 108u8, 116u8, 104u8, 67u8, 104u8, 101u8, 99u8, 107u8, 82u8, 101u8, + 113u8, 117u8, 101u8, 115u8, 116u8, 26u8, 35u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, + 104u8, 101u8, 97u8, 108u8, 116u8, 104u8, 46u8, 118u8, 49u8, 46u8, 72u8, 101u8, 97u8, + 108u8, 116u8, 104u8, 67u8, 104u8, 101u8, 99u8, 107u8, 82u8, 101u8, 115u8, 112u8, + 111u8, 110u8, 115u8, 101u8, 18u8, 82u8, 10u8, 5u8, 87u8, 97u8, 116u8, 99u8, 104u8, + 18u8, 34u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, 104u8, 101u8, 97u8, 108u8, 116u8, + 104u8, 46u8, 118u8, 49u8, 46u8, 72u8, 101u8, 97u8, 108u8, 116u8, 104u8, 67u8, 104u8, + 101u8, 99u8, 107u8, 82u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, 26u8, 35u8, 46u8, + 103u8, 114u8, 112u8, 99u8, 46u8, 104u8, 101u8, 97u8, 108u8, 116u8, 104u8, 46u8, + 118u8, 49u8, 46u8, 72u8, 101u8, 97u8, 108u8, 116u8, 104u8, 67u8, 104u8, 101u8, 99u8, + 107u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 48u8, 1u8, 66u8, 97u8, + 10u8, 17u8, 105u8, 111u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, 104u8, 101u8, 97u8, + 108u8, 116u8, 104u8, 46u8, 118u8, 49u8, 66u8, 11u8, 72u8, 101u8, 97u8, 108u8, 116u8, + 104u8, 80u8, 114u8, 111u8, 116u8, 111u8, 80u8, 1u8, 90u8, 44u8, 103u8, 111u8, 111u8, + 103u8, 108u8, 101u8, 46u8, 103u8, 111u8, 108u8, 97u8, 110u8, 103u8, 46u8, 111u8, + 114u8, 103u8, 47u8, 103u8, 114u8, 112u8, 99u8, 47u8, 104u8, 101u8, 97u8, 108u8, + 116u8, 104u8, 47u8, 103u8, 114u8, 112u8, 99u8, 95u8, 104u8, 101u8, 97u8, 108u8, + 116u8, 104u8, 95u8, 118u8, 49u8, 170u8, 2u8, 14u8, 71u8, 114u8, 112u8, 99u8, 46u8, + 72u8, 101u8, 97u8, 108u8, 116u8, 104u8, 46u8, 86u8, 49u8, 98u8, 6u8, 112u8, 114u8, + 111u8, 116u8, 111u8, 51u8, ]; diff --git a/tonic-reflection/src/generated/reflection_v1_fds.rs b/tonic-reflection/src/generated/reflection_v1_fds.rs index cf2078487..894146337 100644 --- a/tonic-reflection/src/generated/reflection_v1_fds.rs +++ b/tonic-reflection/src/generated/reflection_v1_fds.rs @@ -1,1735 +1,141 @@ // This file is @generated by codegen. /// Byte encoded FILE_DESCRIPTOR_SET. pub const FILE_DESCRIPTOR_SET: &[u8] = &[ - 10u8, - 192u8, - 13u8, - 10u8, - 19u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 95u8, - 118u8, - 49u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 18u8, - 18u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 34u8, - 243u8, - 2u8, - 10u8, - 23u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 18u8, - 18u8, - 10u8, - 4u8, - 104u8, - 111u8, - 115u8, - 116u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 4u8, - 104u8, - 111u8, - 115u8, - 116u8, - 18u8, - 42u8, - 10u8, - 16u8, - 102u8, - 105u8, - 108u8, - 101u8, - 95u8, - 98u8, - 121u8, - 95u8, - 102u8, - 105u8, - 108u8, - 101u8, - 110u8, - 97u8, - 109u8, - 101u8, - 24u8, - 3u8, - 32u8, - 1u8, - 40u8, - 9u8, - 72u8, - 0u8, - 82u8, - 14u8, - 102u8, - 105u8, - 108u8, - 101u8, - 66u8, - 121u8, - 70u8, - 105u8, - 108u8, - 101u8, - 110u8, - 97u8, - 109u8, - 101u8, - 18u8, - 54u8, - 10u8, - 22u8, - 102u8, - 105u8, - 108u8, - 101u8, - 95u8, - 99u8, - 111u8, - 110u8, - 116u8, - 97u8, - 105u8, - 110u8, - 105u8, - 110u8, - 103u8, - 95u8, - 115u8, - 121u8, - 109u8, - 98u8, - 111u8, - 108u8, - 24u8, - 4u8, - 32u8, - 1u8, - 40u8, - 9u8, - 72u8, - 0u8, - 82u8, - 20u8, - 102u8, - 105u8, - 108u8, - 101u8, - 67u8, - 111u8, - 110u8, - 116u8, - 97u8, - 105u8, - 110u8, - 105u8, - 110u8, - 103u8, - 83u8, - 121u8, - 109u8, - 98u8, - 111u8, - 108u8, - 18u8, - 98u8, - 10u8, - 25u8, - 102u8, - 105u8, - 108u8, - 101u8, - 95u8, - 99u8, - 111u8, - 110u8, - 116u8, - 97u8, - 105u8, - 110u8, - 105u8, - 110u8, - 103u8, - 95u8, - 101u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 24u8, - 5u8, - 32u8, - 1u8, - 40u8, - 11u8, - 50u8, - 36u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 46u8, - 69u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 72u8, - 0u8, - 82u8, - 23u8, - 102u8, - 105u8, - 108u8, - 101u8, - 67u8, - 111u8, - 110u8, - 116u8, - 97u8, - 105u8, - 110u8, - 105u8, - 110u8, - 103u8, - 69u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 18u8, - 66u8, - 10u8, - 29u8, - 97u8, - 108u8, - 108u8, - 95u8, - 101u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 95u8, - 110u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 115u8, - 95u8, - 111u8, - 102u8, - 95u8, - 116u8, - 121u8, - 112u8, - 101u8, - 24u8, - 6u8, - 32u8, - 1u8, - 40u8, - 9u8, - 72u8, - 0u8, - 82u8, - 25u8, - 97u8, - 108u8, - 108u8, - 69u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 78u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 115u8, - 79u8, - 102u8, - 84u8, - 121u8, - 112u8, - 101u8, - 18u8, - 37u8, - 10u8, - 13u8, - 108u8, - 105u8, - 115u8, - 116u8, - 95u8, - 115u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 115u8, - 24u8, - 7u8, - 32u8, - 1u8, - 40u8, - 9u8, - 72u8, - 0u8, - 82u8, - 12u8, - 108u8, - 105u8, - 115u8, - 116u8, - 83u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 115u8, - 66u8, - 17u8, - 10u8, - 15u8, - 109u8, - 101u8, - 115u8, - 115u8, - 97u8, - 103u8, - 101u8, - 95u8, - 114u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 34u8, - 102u8, - 10u8, - 16u8, - 69u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 18u8, - 39u8, - 10u8, - 15u8, - 99u8, - 111u8, - 110u8, - 116u8, - 97u8, - 105u8, - 110u8, - 105u8, - 110u8, - 103u8, - 95u8, - 116u8, - 121u8, - 112u8, - 101u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 14u8, - 99u8, - 111u8, - 110u8, - 116u8, - 97u8, - 105u8, - 110u8, - 105u8, - 110u8, - 103u8, - 84u8, - 121u8, - 112u8, - 101u8, - 18u8, - 41u8, - 10u8, - 16u8, - 101u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 95u8, - 110u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 5u8, - 82u8, - 15u8, - 101u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 78u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 34u8, - 174u8, - 4u8, - 10u8, - 24u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 29u8, - 10u8, - 10u8, - 118u8, - 97u8, - 108u8, - 105u8, - 100u8, - 95u8, - 104u8, - 111u8, - 115u8, - 116u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 9u8, - 118u8, - 97u8, - 108u8, - 105u8, - 100u8, - 72u8, - 111u8, - 115u8, - 116u8, - 18u8, - 86u8, - 10u8, - 16u8, - 111u8, - 114u8, - 105u8, - 103u8, - 105u8, - 110u8, - 97u8, - 108u8, - 95u8, - 114u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 11u8, - 50u8, - 43u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 46u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 82u8, - 15u8, - 111u8, - 114u8, - 105u8, - 103u8, - 105u8, - 110u8, - 97u8, - 108u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 18u8, - 102u8, - 10u8, - 24u8, - 102u8, - 105u8, - 108u8, - 101u8, - 95u8, - 100u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 111u8, - 114u8, - 95u8, - 114u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 24u8, - 4u8, - 32u8, - 1u8, - 40u8, - 11u8, - 50u8, - 42u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 46u8, - 70u8, - 105u8, - 108u8, - 101u8, - 68u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 111u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 72u8, - 0u8, - 82u8, - 22u8, - 102u8, - 105u8, - 108u8, - 101u8, - 68u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 111u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 114u8, - 10u8, - 30u8, - 97u8, - 108u8, - 108u8, - 95u8, - 101u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 95u8, - 110u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 115u8, - 95u8, - 114u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 24u8, - 5u8, - 32u8, - 1u8, - 40u8, - 11u8, - 50u8, - 43u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 46u8, - 69u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 78u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 72u8, - 0u8, - 82u8, - 27u8, - 97u8, - 108u8, - 108u8, - 69u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 78u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 115u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 95u8, - 10u8, - 22u8, - 108u8, - 105u8, - 115u8, - 116u8, - 95u8, - 115u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 115u8, - 95u8, - 114u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 24u8, - 6u8, - 32u8, - 1u8, - 40u8, - 11u8, - 50u8, - 39u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 46u8, - 76u8, - 105u8, - 115u8, - 116u8, - 83u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 72u8, - 0u8, - 82u8, - 20u8, - 108u8, - 105u8, - 115u8, - 116u8, - 83u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 115u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 74u8, - 10u8, - 14u8, - 101u8, - 114u8, - 114u8, - 111u8, - 114u8, - 95u8, - 114u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 24u8, - 7u8, - 32u8, - 1u8, - 40u8, - 11u8, - 50u8, - 33u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 46u8, - 69u8, - 114u8, - 114u8, - 111u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 72u8, - 0u8, - 82u8, - 13u8, - 101u8, - 114u8, - 114u8, - 111u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 66u8, - 18u8, - 10u8, - 16u8, - 109u8, - 101u8, - 115u8, - 115u8, - 97u8, - 103u8, - 101u8, - 95u8, - 114u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 34u8, - 76u8, - 10u8, - 22u8, - 70u8, - 105u8, - 108u8, - 101u8, - 68u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 111u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 50u8, - 10u8, - 21u8, - 102u8, - 105u8, - 108u8, - 101u8, - 95u8, - 100u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 111u8, - 114u8, - 95u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 24u8, - 1u8, - 32u8, - 3u8, - 40u8, - 12u8, - 82u8, - 19u8, - 102u8, - 105u8, - 108u8, - 101u8, - 68u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 111u8, - 114u8, - 80u8, - 114u8, - 111u8, - 116u8, - 111u8, - 34u8, - 106u8, - 10u8, - 23u8, - 69u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 78u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 36u8, - 10u8, - 14u8, - 98u8, - 97u8, - 115u8, - 101u8, - 95u8, - 116u8, - 121u8, - 112u8, - 101u8, - 95u8, - 110u8, - 97u8, - 109u8, - 101u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 12u8, - 98u8, - 97u8, - 115u8, - 101u8, - 84u8, - 121u8, - 112u8, - 101u8, - 78u8, - 97u8, - 109u8, - 101u8, - 18u8, - 41u8, - 10u8, - 16u8, - 101u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 95u8, - 110u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 24u8, - 2u8, - 32u8, - 3u8, - 40u8, - 5u8, - 82u8, - 15u8, - 101u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 78u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 34u8, - 84u8, - 10u8, - 19u8, - 76u8, - 105u8, - 115u8, - 116u8, - 83u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 61u8, - 10u8, - 7u8, - 115u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 24u8, - 1u8, - 32u8, - 3u8, - 40u8, - 11u8, - 50u8, - 35u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 46u8, - 83u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 82u8, - 7u8, - 115u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 34u8, - 37u8, - 10u8, - 15u8, - 83u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 18u8, - 10u8, - 4u8, - 110u8, - 97u8, - 109u8, - 101u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 4u8, - 110u8, - 97u8, - 109u8, - 101u8, - 34u8, - 83u8, - 10u8, - 13u8, - 69u8, - 114u8, - 114u8, - 111u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 29u8, - 10u8, - 10u8, - 101u8, - 114u8, - 114u8, - 111u8, - 114u8, - 95u8, - 99u8, - 111u8, - 100u8, - 101u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 5u8, - 82u8, - 9u8, - 101u8, - 114u8, - 114u8, - 111u8, - 114u8, - 67u8, - 111u8, - 100u8, - 101u8, - 18u8, - 35u8, - 10u8, - 13u8, - 101u8, - 114u8, - 114u8, - 111u8, - 114u8, - 95u8, - 109u8, - 101u8, - 115u8, - 115u8, - 97u8, - 103u8, - 101u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 12u8, - 101u8, - 114u8, - 114u8, - 111u8, - 114u8, - 77u8, - 101u8, - 115u8, - 115u8, - 97u8, - 103u8, - 101u8, - 50u8, - 137u8, - 1u8, - 10u8, - 16u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 18u8, - 117u8, - 10u8, - 20u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 73u8, - 110u8, - 102u8, - 111u8, - 18u8, - 43u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 46u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 26u8, - 44u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 46u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 40u8, - 1u8, - 48u8, - 1u8, - 66u8, - 102u8, - 10u8, - 21u8, - 105u8, - 111u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 66u8, - 21u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 80u8, - 114u8, - 111u8, - 116u8, - 111u8, - 80u8, - 1u8, - 90u8, - 52u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 103u8, - 111u8, - 108u8, - 97u8, - 110u8, - 103u8, - 46u8, - 111u8, - 114u8, - 103u8, - 47u8, - 103u8, - 114u8, - 112u8, - 99u8, - 47u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 47u8, - 103u8, - 114u8, - 112u8, - 99u8, - 95u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 95u8, - 118u8, - 49u8, - 98u8, - 6u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 51u8, + 10u8, 192u8, 13u8, 10u8, 19u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, + 111u8, 110u8, 95u8, 118u8, 49u8, 46u8, 112u8, 114u8, 111u8, 116u8, 111u8, 18u8, 18u8, + 103u8, 114u8, 112u8, 99u8, 46u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, + 105u8, 111u8, 110u8, 46u8, 118u8, 49u8, 34u8, 243u8, 2u8, 10u8, 23u8, 83u8, 101u8, + 114u8, 118u8, 101u8, 114u8, 82u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, + 111u8, 110u8, 82u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, 18u8, 18u8, 10u8, 4u8, + 104u8, 111u8, 115u8, 116u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, 4u8, 104u8, 111u8, + 115u8, 116u8, 18u8, 42u8, 10u8, 16u8, 102u8, 105u8, 108u8, 101u8, 95u8, 98u8, 121u8, + 95u8, 102u8, 105u8, 108u8, 101u8, 110u8, 97u8, 109u8, 101u8, 24u8, 3u8, 32u8, 1u8, + 40u8, 9u8, 72u8, 0u8, 82u8, 14u8, 102u8, 105u8, 108u8, 101u8, 66u8, 121u8, 70u8, + 105u8, 108u8, 101u8, 110u8, 97u8, 109u8, 101u8, 18u8, 54u8, 10u8, 22u8, 102u8, 105u8, + 108u8, 101u8, 95u8, 99u8, 111u8, 110u8, 116u8, 97u8, 105u8, 110u8, 105u8, 110u8, + 103u8, 95u8, 115u8, 121u8, 109u8, 98u8, 111u8, 108u8, 24u8, 4u8, 32u8, 1u8, 40u8, + 9u8, 72u8, 0u8, 82u8, 20u8, 102u8, 105u8, 108u8, 101u8, 67u8, 111u8, 110u8, 116u8, + 97u8, 105u8, 110u8, 105u8, 110u8, 103u8, 83u8, 121u8, 109u8, 98u8, 111u8, 108u8, + 18u8, 98u8, 10u8, 25u8, 102u8, 105u8, 108u8, 101u8, 95u8, 99u8, 111u8, 110u8, 116u8, + 97u8, 105u8, 110u8, 105u8, 110u8, 103u8, 95u8, 101u8, 120u8, 116u8, 101u8, 110u8, + 115u8, 105u8, 111u8, 110u8, 24u8, 5u8, 32u8, 1u8, 40u8, 11u8, 50u8, 36u8, 46u8, + 103u8, 114u8, 112u8, 99u8, 46u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, + 105u8, 111u8, 110u8, 46u8, 118u8, 49u8, 46u8, 69u8, 120u8, 116u8, 101u8, 110u8, + 115u8, 105u8, 111u8, 110u8, 82u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, 72u8, + 0u8, 82u8, 23u8, 102u8, 105u8, 108u8, 101u8, 67u8, 111u8, 110u8, 116u8, 97u8, 105u8, + 110u8, 105u8, 110u8, 103u8, 69u8, 120u8, 116u8, 101u8, 110u8, 115u8, 105u8, 111u8, + 110u8, 18u8, 66u8, 10u8, 29u8, 97u8, 108u8, 108u8, 95u8, 101u8, 120u8, 116u8, 101u8, + 110u8, 115u8, 105u8, 111u8, 110u8, 95u8, 110u8, 117u8, 109u8, 98u8, 101u8, 114u8, + 115u8, 95u8, 111u8, 102u8, 95u8, 116u8, 121u8, 112u8, 101u8, 24u8, 6u8, 32u8, 1u8, + 40u8, 9u8, 72u8, 0u8, 82u8, 25u8, 97u8, 108u8, 108u8, 69u8, 120u8, 116u8, 101u8, + 110u8, 115u8, 105u8, 111u8, 110u8, 78u8, 117u8, 109u8, 98u8, 101u8, 114u8, 115u8, + 79u8, 102u8, 84u8, 121u8, 112u8, 101u8, 18u8, 37u8, 10u8, 13u8, 108u8, 105u8, 115u8, + 116u8, 95u8, 115u8, 101u8, 114u8, 118u8, 105u8, 99u8, 101u8, 115u8, 24u8, 7u8, 32u8, + 1u8, 40u8, 9u8, 72u8, 0u8, 82u8, 12u8, 108u8, 105u8, 115u8, 116u8, 83u8, 101u8, + 114u8, 118u8, 105u8, 99u8, 101u8, 115u8, 66u8, 17u8, 10u8, 15u8, 109u8, 101u8, 115u8, + 115u8, 97u8, 103u8, 101u8, 95u8, 114u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, + 34u8, 102u8, 10u8, 16u8, 69u8, 120u8, 116u8, 101u8, 110u8, 115u8, 105u8, 111u8, + 110u8, 82u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, 18u8, 39u8, 10u8, 15u8, 99u8, + 111u8, 110u8, 116u8, 97u8, 105u8, 110u8, 105u8, 110u8, 103u8, 95u8, 116u8, 121u8, + 112u8, 101u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, 14u8, 99u8, 111u8, 110u8, 116u8, + 97u8, 105u8, 110u8, 105u8, 110u8, 103u8, 84u8, 121u8, 112u8, 101u8, 18u8, 41u8, 10u8, + 16u8, 101u8, 120u8, 116u8, 101u8, 110u8, 115u8, 105u8, 111u8, 110u8, 95u8, 110u8, + 117u8, 109u8, 98u8, 101u8, 114u8, 24u8, 2u8, 32u8, 1u8, 40u8, 5u8, 82u8, 15u8, 101u8, + 120u8, 116u8, 101u8, 110u8, 115u8, 105u8, 111u8, 110u8, 78u8, 117u8, 109u8, 98u8, + 101u8, 114u8, 34u8, 174u8, 4u8, 10u8, 24u8, 83u8, 101u8, 114u8, 118u8, 101u8, 114u8, + 82u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 82u8, 101u8, + 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 18u8, 29u8, 10u8, 10u8, 118u8, 97u8, 108u8, + 105u8, 100u8, 95u8, 104u8, 111u8, 115u8, 116u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, + 82u8, 9u8, 118u8, 97u8, 108u8, 105u8, 100u8, 72u8, 111u8, 115u8, 116u8, 18u8, 86u8, + 10u8, 16u8, 111u8, 114u8, 105u8, 103u8, 105u8, 110u8, 97u8, 108u8, 95u8, 114u8, + 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, 24u8, 2u8, 32u8, 1u8, 40u8, 11u8, 50u8, + 43u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, + 116u8, 105u8, 111u8, 110u8, 46u8, 118u8, 49u8, 46u8, 83u8, 101u8, 114u8, 118u8, + 101u8, 114u8, 82u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, + 82u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, 82u8, 15u8, 111u8, 114u8, 105u8, + 103u8, 105u8, 110u8, 97u8, 108u8, 82u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, + 18u8, 102u8, 10u8, 24u8, 102u8, 105u8, 108u8, 101u8, 95u8, 100u8, 101u8, 115u8, 99u8, + 114u8, 105u8, 112u8, 116u8, 111u8, 114u8, 95u8, 114u8, 101u8, 115u8, 112u8, 111u8, + 110u8, 115u8, 101u8, 24u8, 4u8, 32u8, 1u8, 40u8, 11u8, 50u8, 42u8, 46u8, 103u8, + 114u8, 112u8, 99u8, 46u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, + 111u8, 110u8, 46u8, 118u8, 49u8, 46u8, 70u8, 105u8, 108u8, 101u8, 68u8, 101u8, 115u8, + 99u8, 114u8, 105u8, 112u8, 116u8, 111u8, 114u8, 82u8, 101u8, 115u8, 112u8, 111u8, + 110u8, 115u8, 101u8, 72u8, 0u8, 82u8, 22u8, 102u8, 105u8, 108u8, 101u8, 68u8, 101u8, + 115u8, 99u8, 114u8, 105u8, 112u8, 116u8, 111u8, 114u8, 82u8, 101u8, 115u8, 112u8, + 111u8, 110u8, 115u8, 101u8, 18u8, 114u8, 10u8, 30u8, 97u8, 108u8, 108u8, 95u8, 101u8, + 120u8, 116u8, 101u8, 110u8, 115u8, 105u8, 111u8, 110u8, 95u8, 110u8, 117u8, 109u8, + 98u8, 101u8, 114u8, 115u8, 95u8, 114u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, + 101u8, 24u8, 5u8, 32u8, 1u8, 40u8, 11u8, 50u8, 43u8, 46u8, 103u8, 114u8, 112u8, 99u8, + 46u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 46u8, + 118u8, 49u8, 46u8, 69u8, 120u8, 116u8, 101u8, 110u8, 115u8, 105u8, 111u8, 110u8, + 78u8, 117u8, 109u8, 98u8, 101u8, 114u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, + 115u8, 101u8, 72u8, 0u8, 82u8, 27u8, 97u8, 108u8, 108u8, 69u8, 120u8, 116u8, 101u8, + 110u8, 115u8, 105u8, 111u8, 110u8, 78u8, 117u8, 109u8, 98u8, 101u8, 114u8, 115u8, + 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 18u8, 95u8, 10u8, 22u8, 108u8, + 105u8, 115u8, 116u8, 95u8, 115u8, 101u8, 114u8, 118u8, 105u8, 99u8, 101u8, 115u8, + 95u8, 114u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 24u8, 6u8, 32u8, 1u8, + 40u8, 11u8, 50u8, 39u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, 114u8, 101u8, 102u8, + 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 46u8, 118u8, 49u8, 46u8, 76u8, 105u8, + 115u8, 116u8, 83u8, 101u8, 114u8, 118u8, 105u8, 99u8, 101u8, 82u8, 101u8, 115u8, + 112u8, 111u8, 110u8, 115u8, 101u8, 72u8, 0u8, 82u8, 20u8, 108u8, 105u8, 115u8, 116u8, + 83u8, 101u8, 114u8, 118u8, 105u8, 99u8, 101u8, 115u8, 82u8, 101u8, 115u8, 112u8, + 111u8, 110u8, 115u8, 101u8, 18u8, 74u8, 10u8, 14u8, 101u8, 114u8, 114u8, 111u8, + 114u8, 95u8, 114u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 24u8, 7u8, 32u8, + 1u8, 40u8, 11u8, 50u8, 33u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, 114u8, 101u8, + 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 46u8, 118u8, 49u8, 46u8, 69u8, + 114u8, 114u8, 111u8, 114u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, + 72u8, 0u8, 82u8, 13u8, 101u8, 114u8, 114u8, 111u8, 114u8, 82u8, 101u8, 115u8, 112u8, + 111u8, 110u8, 115u8, 101u8, 66u8, 18u8, 10u8, 16u8, 109u8, 101u8, 115u8, 115u8, 97u8, + 103u8, 101u8, 95u8, 114u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 34u8, + 76u8, 10u8, 22u8, 70u8, 105u8, 108u8, 101u8, 68u8, 101u8, 115u8, 99u8, 114u8, 105u8, + 112u8, 116u8, 111u8, 114u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, + 18u8, 50u8, 10u8, 21u8, 102u8, 105u8, 108u8, 101u8, 95u8, 100u8, 101u8, 115u8, 99u8, + 114u8, 105u8, 112u8, 116u8, 111u8, 114u8, 95u8, 112u8, 114u8, 111u8, 116u8, 111u8, + 24u8, 1u8, 32u8, 3u8, 40u8, 12u8, 82u8, 19u8, 102u8, 105u8, 108u8, 101u8, 68u8, + 101u8, 115u8, 99u8, 114u8, 105u8, 112u8, 116u8, 111u8, 114u8, 80u8, 114u8, 111u8, + 116u8, 111u8, 34u8, 106u8, 10u8, 23u8, 69u8, 120u8, 116u8, 101u8, 110u8, 115u8, + 105u8, 111u8, 110u8, 78u8, 117u8, 109u8, 98u8, 101u8, 114u8, 82u8, 101u8, 115u8, + 112u8, 111u8, 110u8, 115u8, 101u8, 18u8, 36u8, 10u8, 14u8, 98u8, 97u8, 115u8, 101u8, + 95u8, 116u8, 121u8, 112u8, 101u8, 95u8, 110u8, 97u8, 109u8, 101u8, 24u8, 1u8, 32u8, + 1u8, 40u8, 9u8, 82u8, 12u8, 98u8, 97u8, 115u8, 101u8, 84u8, 121u8, 112u8, 101u8, + 78u8, 97u8, 109u8, 101u8, 18u8, 41u8, 10u8, 16u8, 101u8, 120u8, 116u8, 101u8, 110u8, + 115u8, 105u8, 111u8, 110u8, 95u8, 110u8, 117u8, 109u8, 98u8, 101u8, 114u8, 24u8, 2u8, + 32u8, 3u8, 40u8, 5u8, 82u8, 15u8, 101u8, 120u8, 116u8, 101u8, 110u8, 115u8, 105u8, + 111u8, 110u8, 78u8, 117u8, 109u8, 98u8, 101u8, 114u8, 34u8, 84u8, 10u8, 19u8, 76u8, + 105u8, 115u8, 116u8, 83u8, 101u8, 114u8, 118u8, 105u8, 99u8, 101u8, 82u8, 101u8, + 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 18u8, 61u8, 10u8, 7u8, 115u8, 101u8, 114u8, + 118u8, 105u8, 99u8, 101u8, 24u8, 1u8, 32u8, 3u8, 40u8, 11u8, 50u8, 35u8, 46u8, 103u8, + 114u8, 112u8, 99u8, 46u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, + 111u8, 110u8, 46u8, 118u8, 49u8, 46u8, 83u8, 101u8, 114u8, 118u8, 105u8, 99u8, 101u8, + 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 82u8, 7u8, 115u8, 101u8, + 114u8, 118u8, 105u8, 99u8, 101u8, 34u8, 37u8, 10u8, 15u8, 83u8, 101u8, 114u8, 118u8, + 105u8, 99u8, 101u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 18u8, + 18u8, 10u8, 4u8, 110u8, 97u8, 109u8, 101u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, + 4u8, 110u8, 97u8, 109u8, 101u8, 34u8, 83u8, 10u8, 13u8, 69u8, 114u8, 114u8, 111u8, + 114u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 18u8, 29u8, 10u8, 10u8, + 101u8, 114u8, 114u8, 111u8, 114u8, 95u8, 99u8, 111u8, 100u8, 101u8, 24u8, 1u8, 32u8, + 1u8, 40u8, 5u8, 82u8, 9u8, 101u8, 114u8, 114u8, 111u8, 114u8, 67u8, 111u8, 100u8, + 101u8, 18u8, 35u8, 10u8, 13u8, 101u8, 114u8, 114u8, 111u8, 114u8, 95u8, 109u8, 101u8, + 115u8, 115u8, 97u8, 103u8, 101u8, 24u8, 2u8, 32u8, 1u8, 40u8, 9u8, 82u8, 12u8, 101u8, + 114u8, 114u8, 111u8, 114u8, 77u8, 101u8, 115u8, 115u8, 97u8, 103u8, 101u8, 50u8, + 137u8, 1u8, 10u8, 16u8, 83u8, 101u8, 114u8, 118u8, 101u8, 114u8, 82u8, 101u8, 102u8, + 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 18u8, 117u8, 10u8, 20u8, 83u8, 101u8, + 114u8, 118u8, 101u8, 114u8, 82u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, + 111u8, 110u8, 73u8, 110u8, 102u8, 111u8, 18u8, 43u8, 46u8, 103u8, 114u8, 112u8, 99u8, + 46u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 46u8, + 118u8, 49u8, 46u8, 83u8, 101u8, 114u8, 118u8, 101u8, 114u8, 82u8, 101u8, 102u8, + 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 82u8, 101u8, 113u8, 117u8, 101u8, + 115u8, 116u8, 26u8, 44u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, 114u8, 101u8, 102u8, + 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 46u8, 118u8, 49u8, 46u8, 83u8, 101u8, + 114u8, 118u8, 101u8, 114u8, 82u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, + 111u8, 110u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 40u8, 1u8, 48u8, + 1u8, 66u8, 102u8, 10u8, 21u8, 105u8, 111u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, + 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 46u8, 118u8, + 49u8, 66u8, 21u8, 83u8, 101u8, 114u8, 118u8, 101u8, 114u8, 82u8, 101u8, 102u8, 108u8, + 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 80u8, 114u8, 111u8, 116u8, 111u8, 80u8, 1u8, + 90u8, 52u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, 46u8, 103u8, 111u8, 108u8, + 97u8, 110u8, 103u8, 46u8, 111u8, 114u8, 103u8, 47u8, 103u8, 114u8, 112u8, 99u8, 47u8, + 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 47u8, 103u8, + 114u8, 112u8, 99u8, 95u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, + 111u8, 110u8, 95u8, 118u8, 49u8, 98u8, 6u8, 112u8, 114u8, 111u8, 116u8, 111u8, 51u8, ]; diff --git a/tonic-reflection/src/generated/reflection_v1alpha1_fds.rs b/tonic-reflection/src/generated/reflection_v1alpha1_fds.rs index 18032a734..699e4268c 100644 --- a/tonic-reflection/src/generated/reflection_v1alpha1_fds.rs +++ b/tonic-reflection/src/generated/reflection_v1alpha1_fds.rs @@ -1,1686 +1,138 @@ // This file is @generated by codegen. /// Byte encoded FILE_DESCRIPTOR_SET. pub const FILE_DESCRIPTOR_SET: &[u8] = &[ - 10u8, - 143u8, - 13u8, - 10u8, - 24u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 95u8, - 118u8, - 49u8, - 97u8, - 108u8, - 112u8, - 104u8, - 97u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 18u8, - 23u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 97u8, - 108u8, - 112u8, - 104u8, - 97u8, - 34u8, - 248u8, - 2u8, - 10u8, - 23u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 18u8, - 18u8, - 10u8, - 4u8, - 104u8, - 111u8, - 115u8, - 116u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 4u8, - 104u8, - 111u8, - 115u8, - 116u8, - 18u8, - 42u8, - 10u8, - 16u8, - 102u8, - 105u8, - 108u8, - 101u8, - 95u8, - 98u8, - 121u8, - 95u8, - 102u8, - 105u8, - 108u8, - 101u8, - 110u8, - 97u8, - 109u8, - 101u8, - 24u8, - 3u8, - 32u8, - 1u8, - 40u8, - 9u8, - 72u8, - 0u8, - 82u8, - 14u8, - 102u8, - 105u8, - 108u8, - 101u8, - 66u8, - 121u8, - 70u8, - 105u8, - 108u8, - 101u8, - 110u8, - 97u8, - 109u8, - 101u8, - 18u8, - 54u8, - 10u8, - 22u8, - 102u8, - 105u8, - 108u8, - 101u8, - 95u8, - 99u8, - 111u8, - 110u8, - 116u8, - 97u8, - 105u8, - 110u8, - 105u8, - 110u8, - 103u8, - 95u8, - 115u8, - 121u8, - 109u8, - 98u8, - 111u8, - 108u8, - 24u8, - 4u8, - 32u8, - 1u8, - 40u8, - 9u8, - 72u8, - 0u8, - 82u8, - 20u8, - 102u8, - 105u8, - 108u8, - 101u8, - 67u8, - 111u8, - 110u8, - 116u8, - 97u8, - 105u8, - 110u8, - 105u8, - 110u8, - 103u8, - 83u8, - 121u8, - 109u8, - 98u8, - 111u8, - 108u8, - 18u8, - 103u8, - 10u8, - 25u8, - 102u8, - 105u8, - 108u8, - 101u8, - 95u8, - 99u8, - 111u8, - 110u8, - 116u8, - 97u8, - 105u8, - 110u8, - 105u8, - 110u8, - 103u8, - 95u8, - 101u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 24u8, - 5u8, - 32u8, - 1u8, - 40u8, - 11u8, - 50u8, - 41u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 97u8, - 108u8, - 112u8, - 104u8, - 97u8, - 46u8, - 69u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 72u8, - 0u8, - 82u8, - 23u8, - 102u8, - 105u8, - 108u8, - 101u8, - 67u8, - 111u8, - 110u8, - 116u8, - 97u8, - 105u8, - 110u8, - 105u8, - 110u8, - 103u8, - 69u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 18u8, - 66u8, - 10u8, - 29u8, - 97u8, - 108u8, - 108u8, - 95u8, - 101u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 95u8, - 110u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 115u8, - 95u8, - 111u8, - 102u8, - 95u8, - 116u8, - 121u8, - 112u8, - 101u8, - 24u8, - 6u8, - 32u8, - 1u8, - 40u8, - 9u8, - 72u8, - 0u8, - 82u8, - 25u8, - 97u8, - 108u8, - 108u8, - 69u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 78u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 115u8, - 79u8, - 102u8, - 84u8, - 121u8, - 112u8, - 101u8, - 18u8, - 37u8, - 10u8, - 13u8, - 108u8, - 105u8, - 115u8, - 116u8, - 95u8, - 115u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 115u8, - 24u8, - 7u8, - 32u8, - 1u8, - 40u8, - 9u8, - 72u8, - 0u8, - 82u8, - 12u8, - 108u8, - 105u8, - 115u8, - 116u8, - 83u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 115u8, - 66u8, - 17u8, - 10u8, - 15u8, - 109u8, - 101u8, - 115u8, - 115u8, - 97u8, - 103u8, - 101u8, - 95u8, - 114u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 34u8, - 102u8, - 10u8, - 16u8, - 69u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 18u8, - 39u8, - 10u8, - 15u8, - 99u8, - 111u8, - 110u8, - 116u8, - 97u8, - 105u8, - 110u8, - 105u8, - 110u8, - 103u8, - 95u8, - 116u8, - 121u8, - 112u8, - 101u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 14u8, - 99u8, - 111u8, - 110u8, - 116u8, - 97u8, - 105u8, - 110u8, - 105u8, - 110u8, - 103u8, - 84u8, - 121u8, - 112u8, - 101u8, - 18u8, - 41u8, - 10u8, - 16u8, - 101u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 95u8, - 110u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 5u8, - 82u8, - 15u8, - 101u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 78u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 34u8, - 199u8, - 4u8, - 10u8, - 24u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 29u8, - 10u8, - 10u8, - 118u8, - 97u8, - 108u8, - 105u8, - 100u8, - 95u8, - 104u8, - 111u8, - 115u8, - 116u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 9u8, - 118u8, - 97u8, - 108u8, - 105u8, - 100u8, - 72u8, - 111u8, - 115u8, - 116u8, - 18u8, - 91u8, - 10u8, - 16u8, - 111u8, - 114u8, - 105u8, - 103u8, - 105u8, - 110u8, - 97u8, - 108u8, - 95u8, - 114u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 11u8, - 50u8, - 48u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 97u8, - 108u8, - 112u8, - 104u8, - 97u8, - 46u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 82u8, - 15u8, - 111u8, - 114u8, - 105u8, - 103u8, - 105u8, - 110u8, - 97u8, - 108u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 18u8, - 107u8, - 10u8, - 24u8, - 102u8, - 105u8, - 108u8, - 101u8, - 95u8, - 100u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 111u8, - 114u8, - 95u8, - 114u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 24u8, - 4u8, - 32u8, - 1u8, - 40u8, - 11u8, - 50u8, - 47u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 97u8, - 108u8, - 112u8, - 104u8, - 97u8, - 46u8, - 70u8, - 105u8, - 108u8, - 101u8, - 68u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 111u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 72u8, - 0u8, - 82u8, - 22u8, - 102u8, - 105u8, - 108u8, - 101u8, - 68u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 111u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 119u8, - 10u8, - 30u8, - 97u8, - 108u8, - 108u8, - 95u8, - 101u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 95u8, - 110u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 115u8, - 95u8, - 114u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 24u8, - 5u8, - 32u8, - 1u8, - 40u8, - 11u8, - 50u8, - 48u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 97u8, - 108u8, - 112u8, - 104u8, - 97u8, - 46u8, - 69u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 78u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 72u8, - 0u8, - 82u8, - 27u8, - 97u8, - 108u8, - 108u8, - 69u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 78u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 115u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 100u8, - 10u8, - 22u8, - 108u8, - 105u8, - 115u8, - 116u8, - 95u8, - 115u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 115u8, - 95u8, - 114u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 24u8, - 6u8, - 32u8, - 1u8, - 40u8, - 11u8, - 50u8, - 44u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 97u8, - 108u8, - 112u8, - 104u8, - 97u8, - 46u8, - 76u8, - 105u8, - 115u8, - 116u8, - 83u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 72u8, - 0u8, - 82u8, - 20u8, - 108u8, - 105u8, - 115u8, - 116u8, - 83u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 115u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 79u8, - 10u8, - 14u8, - 101u8, - 114u8, - 114u8, - 111u8, - 114u8, - 95u8, - 114u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 24u8, - 7u8, - 32u8, - 1u8, - 40u8, - 11u8, - 50u8, - 38u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 97u8, - 108u8, - 112u8, - 104u8, - 97u8, - 46u8, - 69u8, - 114u8, - 114u8, - 111u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 72u8, - 0u8, - 82u8, - 13u8, - 101u8, - 114u8, - 114u8, - 111u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 66u8, - 18u8, - 10u8, - 16u8, - 109u8, - 101u8, - 115u8, - 115u8, - 97u8, - 103u8, - 101u8, - 95u8, - 114u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 34u8, - 76u8, - 10u8, - 22u8, - 70u8, - 105u8, - 108u8, - 101u8, - 68u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 111u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 50u8, - 10u8, - 21u8, - 102u8, - 105u8, - 108u8, - 101u8, - 95u8, - 100u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 111u8, - 114u8, - 95u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 24u8, - 1u8, - 32u8, - 3u8, - 40u8, - 12u8, - 82u8, - 19u8, - 102u8, - 105u8, - 108u8, - 101u8, - 68u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 111u8, - 114u8, - 80u8, - 114u8, - 111u8, - 116u8, - 111u8, - 34u8, - 106u8, - 10u8, - 23u8, - 69u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 78u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 36u8, - 10u8, - 14u8, - 98u8, - 97u8, - 115u8, - 101u8, - 95u8, - 116u8, - 121u8, - 112u8, - 101u8, - 95u8, - 110u8, - 97u8, - 109u8, - 101u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 12u8, - 98u8, - 97u8, - 115u8, - 101u8, - 84u8, - 121u8, - 112u8, - 101u8, - 78u8, - 97u8, - 109u8, - 101u8, - 18u8, - 41u8, - 10u8, - 16u8, - 101u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 95u8, - 110u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 24u8, - 2u8, - 32u8, - 3u8, - 40u8, - 5u8, - 82u8, - 15u8, - 101u8, - 120u8, - 116u8, - 101u8, - 110u8, - 115u8, - 105u8, - 111u8, - 110u8, - 78u8, - 117u8, - 109u8, - 98u8, - 101u8, - 114u8, - 34u8, - 89u8, - 10u8, - 19u8, - 76u8, - 105u8, - 115u8, - 116u8, - 83u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 66u8, - 10u8, - 7u8, - 115u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 24u8, - 1u8, - 32u8, - 3u8, - 40u8, - 11u8, - 50u8, - 40u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 97u8, - 108u8, - 112u8, - 104u8, - 97u8, - 46u8, - 83u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 82u8, - 7u8, - 115u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 34u8, - 37u8, - 10u8, - 15u8, - 83u8, - 101u8, - 114u8, - 118u8, - 105u8, - 99u8, - 101u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 18u8, - 10u8, - 4u8, - 110u8, - 97u8, - 109u8, - 101u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 4u8, - 110u8, - 97u8, - 109u8, - 101u8, - 34u8, - 83u8, - 10u8, - 13u8, - 69u8, - 114u8, - 114u8, - 111u8, - 114u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 18u8, - 29u8, - 10u8, - 10u8, - 101u8, - 114u8, - 114u8, - 111u8, - 114u8, - 95u8, - 99u8, - 111u8, - 100u8, - 101u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 5u8, - 82u8, - 9u8, - 101u8, - 114u8, - 114u8, - 111u8, - 114u8, - 67u8, - 111u8, - 100u8, - 101u8, - 18u8, - 35u8, - 10u8, - 13u8, - 101u8, - 114u8, - 114u8, - 111u8, - 114u8, - 95u8, - 109u8, - 101u8, - 115u8, - 115u8, - 97u8, - 103u8, - 101u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 12u8, - 101u8, - 114u8, - 114u8, - 111u8, - 114u8, - 77u8, - 101u8, - 115u8, - 115u8, - 97u8, - 103u8, - 101u8, - 50u8, - 147u8, - 1u8, - 10u8, - 16u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 18u8, - 127u8, - 10u8, - 20u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 73u8, - 110u8, - 102u8, - 111u8, - 18u8, - 48u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 97u8, - 108u8, - 112u8, - 104u8, - 97u8, - 46u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 26u8, - 49u8, - 46u8, - 103u8, - 114u8, - 112u8, - 99u8, - 46u8, - 114u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 118u8, - 49u8, - 97u8, - 108u8, - 112u8, - 104u8, - 97u8, - 46u8, - 83u8, - 101u8, - 114u8, - 118u8, - 101u8, - 114u8, - 82u8, - 101u8, - 102u8, - 108u8, - 101u8, - 99u8, - 116u8, - 105u8, - 111u8, - 110u8, - 82u8, - 101u8, - 115u8, - 112u8, - 111u8, - 110u8, - 115u8, - 101u8, - 40u8, - 1u8, - 48u8, - 1u8, - 98u8, - 6u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 51u8, + 10u8, 143u8, 13u8, 10u8, 24u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, + 111u8, 110u8, 95u8, 118u8, 49u8, 97u8, 108u8, 112u8, 104u8, 97u8, 46u8, 112u8, 114u8, + 111u8, 116u8, 111u8, 18u8, 23u8, 103u8, 114u8, 112u8, 99u8, 46u8, 114u8, 101u8, + 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 46u8, 118u8, 49u8, 97u8, + 108u8, 112u8, 104u8, 97u8, 34u8, 248u8, 2u8, 10u8, 23u8, 83u8, 101u8, 114u8, 118u8, + 101u8, 114u8, 82u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, + 82u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, 18u8, 18u8, 10u8, 4u8, 104u8, 111u8, + 115u8, 116u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, 4u8, 104u8, 111u8, 115u8, 116u8, + 18u8, 42u8, 10u8, 16u8, 102u8, 105u8, 108u8, 101u8, 95u8, 98u8, 121u8, 95u8, 102u8, + 105u8, 108u8, 101u8, 110u8, 97u8, 109u8, 101u8, 24u8, 3u8, 32u8, 1u8, 40u8, 9u8, + 72u8, 0u8, 82u8, 14u8, 102u8, 105u8, 108u8, 101u8, 66u8, 121u8, 70u8, 105u8, 108u8, + 101u8, 110u8, 97u8, 109u8, 101u8, 18u8, 54u8, 10u8, 22u8, 102u8, 105u8, 108u8, 101u8, + 95u8, 99u8, 111u8, 110u8, 116u8, 97u8, 105u8, 110u8, 105u8, 110u8, 103u8, 95u8, + 115u8, 121u8, 109u8, 98u8, 111u8, 108u8, 24u8, 4u8, 32u8, 1u8, 40u8, 9u8, 72u8, 0u8, + 82u8, 20u8, 102u8, 105u8, 108u8, 101u8, 67u8, 111u8, 110u8, 116u8, 97u8, 105u8, + 110u8, 105u8, 110u8, 103u8, 83u8, 121u8, 109u8, 98u8, 111u8, 108u8, 18u8, 103u8, + 10u8, 25u8, 102u8, 105u8, 108u8, 101u8, 95u8, 99u8, 111u8, 110u8, 116u8, 97u8, 105u8, + 110u8, 105u8, 110u8, 103u8, 95u8, 101u8, 120u8, 116u8, 101u8, 110u8, 115u8, 105u8, + 111u8, 110u8, 24u8, 5u8, 32u8, 1u8, 40u8, 11u8, 50u8, 41u8, 46u8, 103u8, 114u8, + 112u8, 99u8, 46u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, + 110u8, 46u8, 118u8, 49u8, 97u8, 108u8, 112u8, 104u8, 97u8, 46u8, 69u8, 120u8, 116u8, + 101u8, 110u8, 115u8, 105u8, 111u8, 110u8, 82u8, 101u8, 113u8, 117u8, 101u8, 115u8, + 116u8, 72u8, 0u8, 82u8, 23u8, 102u8, 105u8, 108u8, 101u8, 67u8, 111u8, 110u8, 116u8, + 97u8, 105u8, 110u8, 105u8, 110u8, 103u8, 69u8, 120u8, 116u8, 101u8, 110u8, 115u8, + 105u8, 111u8, 110u8, 18u8, 66u8, 10u8, 29u8, 97u8, 108u8, 108u8, 95u8, 101u8, 120u8, + 116u8, 101u8, 110u8, 115u8, 105u8, 111u8, 110u8, 95u8, 110u8, 117u8, 109u8, 98u8, + 101u8, 114u8, 115u8, 95u8, 111u8, 102u8, 95u8, 116u8, 121u8, 112u8, 101u8, 24u8, 6u8, + 32u8, 1u8, 40u8, 9u8, 72u8, 0u8, 82u8, 25u8, 97u8, 108u8, 108u8, 69u8, 120u8, 116u8, + 101u8, 110u8, 115u8, 105u8, 111u8, 110u8, 78u8, 117u8, 109u8, 98u8, 101u8, 114u8, + 115u8, 79u8, 102u8, 84u8, 121u8, 112u8, 101u8, 18u8, 37u8, 10u8, 13u8, 108u8, 105u8, + 115u8, 116u8, 95u8, 115u8, 101u8, 114u8, 118u8, 105u8, 99u8, 101u8, 115u8, 24u8, 7u8, + 32u8, 1u8, 40u8, 9u8, 72u8, 0u8, 82u8, 12u8, 108u8, 105u8, 115u8, 116u8, 83u8, 101u8, + 114u8, 118u8, 105u8, 99u8, 101u8, 115u8, 66u8, 17u8, 10u8, 15u8, 109u8, 101u8, 115u8, + 115u8, 97u8, 103u8, 101u8, 95u8, 114u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, + 34u8, 102u8, 10u8, 16u8, 69u8, 120u8, 116u8, 101u8, 110u8, 115u8, 105u8, 111u8, + 110u8, 82u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, 18u8, 39u8, 10u8, 15u8, 99u8, + 111u8, 110u8, 116u8, 97u8, 105u8, 110u8, 105u8, 110u8, 103u8, 95u8, 116u8, 121u8, + 112u8, 101u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, 14u8, 99u8, 111u8, 110u8, 116u8, + 97u8, 105u8, 110u8, 105u8, 110u8, 103u8, 84u8, 121u8, 112u8, 101u8, 18u8, 41u8, 10u8, + 16u8, 101u8, 120u8, 116u8, 101u8, 110u8, 115u8, 105u8, 111u8, 110u8, 95u8, 110u8, + 117u8, 109u8, 98u8, 101u8, 114u8, 24u8, 2u8, 32u8, 1u8, 40u8, 5u8, 82u8, 15u8, 101u8, + 120u8, 116u8, 101u8, 110u8, 115u8, 105u8, 111u8, 110u8, 78u8, 117u8, 109u8, 98u8, + 101u8, 114u8, 34u8, 199u8, 4u8, 10u8, 24u8, 83u8, 101u8, 114u8, 118u8, 101u8, 114u8, + 82u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 82u8, 101u8, + 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 18u8, 29u8, 10u8, 10u8, 118u8, 97u8, 108u8, + 105u8, 100u8, 95u8, 104u8, 111u8, 115u8, 116u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, + 82u8, 9u8, 118u8, 97u8, 108u8, 105u8, 100u8, 72u8, 111u8, 115u8, 116u8, 18u8, 91u8, + 10u8, 16u8, 111u8, 114u8, 105u8, 103u8, 105u8, 110u8, 97u8, 108u8, 95u8, 114u8, + 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, 24u8, 2u8, 32u8, 1u8, 40u8, 11u8, 50u8, + 48u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, + 116u8, 105u8, 111u8, 110u8, 46u8, 118u8, 49u8, 97u8, 108u8, 112u8, 104u8, 97u8, 46u8, + 83u8, 101u8, 114u8, 118u8, 101u8, 114u8, 82u8, 101u8, 102u8, 108u8, 101u8, 99u8, + 116u8, 105u8, 111u8, 110u8, 82u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, 82u8, + 15u8, 111u8, 114u8, 105u8, 103u8, 105u8, 110u8, 97u8, 108u8, 82u8, 101u8, 113u8, + 117u8, 101u8, 115u8, 116u8, 18u8, 107u8, 10u8, 24u8, 102u8, 105u8, 108u8, 101u8, + 95u8, 100u8, 101u8, 115u8, 99u8, 114u8, 105u8, 112u8, 116u8, 111u8, 114u8, 95u8, + 114u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 24u8, 4u8, 32u8, 1u8, 40u8, + 11u8, 50u8, 47u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, 114u8, 101u8, 102u8, 108u8, + 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 46u8, 118u8, 49u8, 97u8, 108u8, 112u8, + 104u8, 97u8, 46u8, 70u8, 105u8, 108u8, 101u8, 68u8, 101u8, 115u8, 99u8, 114u8, 105u8, + 112u8, 116u8, 111u8, 114u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, + 72u8, 0u8, 82u8, 22u8, 102u8, 105u8, 108u8, 101u8, 68u8, 101u8, 115u8, 99u8, 114u8, + 105u8, 112u8, 116u8, 111u8, 114u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, + 101u8, 18u8, 119u8, 10u8, 30u8, 97u8, 108u8, 108u8, 95u8, 101u8, 120u8, 116u8, 101u8, + 110u8, 115u8, 105u8, 111u8, 110u8, 95u8, 110u8, 117u8, 109u8, 98u8, 101u8, 114u8, + 115u8, 95u8, 114u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 24u8, 5u8, 32u8, + 1u8, 40u8, 11u8, 50u8, 48u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, 114u8, 101u8, + 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 46u8, 118u8, 49u8, 97u8, + 108u8, 112u8, 104u8, 97u8, 46u8, 69u8, 120u8, 116u8, 101u8, 110u8, 115u8, 105u8, + 111u8, 110u8, 78u8, 117u8, 109u8, 98u8, 101u8, 114u8, 82u8, 101u8, 115u8, 112u8, + 111u8, 110u8, 115u8, 101u8, 72u8, 0u8, 82u8, 27u8, 97u8, 108u8, 108u8, 69u8, 120u8, + 116u8, 101u8, 110u8, 115u8, 105u8, 111u8, 110u8, 78u8, 117u8, 109u8, 98u8, 101u8, + 114u8, 115u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 18u8, 100u8, + 10u8, 22u8, 108u8, 105u8, 115u8, 116u8, 95u8, 115u8, 101u8, 114u8, 118u8, 105u8, + 99u8, 101u8, 115u8, 95u8, 114u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, + 24u8, 6u8, 32u8, 1u8, 40u8, 11u8, 50u8, 44u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, + 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 46u8, 118u8, + 49u8, 97u8, 108u8, 112u8, 104u8, 97u8, 46u8, 76u8, 105u8, 115u8, 116u8, 83u8, 101u8, + 114u8, 118u8, 105u8, 99u8, 101u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, + 101u8, 72u8, 0u8, 82u8, 20u8, 108u8, 105u8, 115u8, 116u8, 83u8, 101u8, 114u8, 118u8, + 105u8, 99u8, 101u8, 115u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, + 18u8, 79u8, 10u8, 14u8, 101u8, 114u8, 114u8, 111u8, 114u8, 95u8, 114u8, 101u8, 115u8, + 112u8, 111u8, 110u8, 115u8, 101u8, 24u8, 7u8, 32u8, 1u8, 40u8, 11u8, 50u8, 38u8, + 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, + 116u8, 105u8, 111u8, 110u8, 46u8, 118u8, 49u8, 97u8, 108u8, 112u8, 104u8, 97u8, 46u8, + 69u8, 114u8, 114u8, 111u8, 114u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, + 101u8, 72u8, 0u8, 82u8, 13u8, 101u8, 114u8, 114u8, 111u8, 114u8, 82u8, 101u8, 115u8, + 112u8, 111u8, 110u8, 115u8, 101u8, 66u8, 18u8, 10u8, 16u8, 109u8, 101u8, 115u8, + 115u8, 97u8, 103u8, 101u8, 95u8, 114u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, + 101u8, 34u8, 76u8, 10u8, 22u8, 70u8, 105u8, 108u8, 101u8, 68u8, 101u8, 115u8, 99u8, + 114u8, 105u8, 112u8, 116u8, 111u8, 114u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, + 115u8, 101u8, 18u8, 50u8, 10u8, 21u8, 102u8, 105u8, 108u8, 101u8, 95u8, 100u8, 101u8, + 115u8, 99u8, 114u8, 105u8, 112u8, 116u8, 111u8, 114u8, 95u8, 112u8, 114u8, 111u8, + 116u8, 111u8, 24u8, 1u8, 32u8, 3u8, 40u8, 12u8, 82u8, 19u8, 102u8, 105u8, 108u8, + 101u8, 68u8, 101u8, 115u8, 99u8, 114u8, 105u8, 112u8, 116u8, 111u8, 114u8, 80u8, + 114u8, 111u8, 116u8, 111u8, 34u8, 106u8, 10u8, 23u8, 69u8, 120u8, 116u8, 101u8, + 110u8, 115u8, 105u8, 111u8, 110u8, 78u8, 117u8, 109u8, 98u8, 101u8, 114u8, 82u8, + 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 18u8, 36u8, 10u8, 14u8, 98u8, 97u8, + 115u8, 101u8, 95u8, 116u8, 121u8, 112u8, 101u8, 95u8, 110u8, 97u8, 109u8, 101u8, + 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, 12u8, 98u8, 97u8, 115u8, 101u8, 84u8, 121u8, + 112u8, 101u8, 78u8, 97u8, 109u8, 101u8, 18u8, 41u8, 10u8, 16u8, 101u8, 120u8, 116u8, + 101u8, 110u8, 115u8, 105u8, 111u8, 110u8, 95u8, 110u8, 117u8, 109u8, 98u8, 101u8, + 114u8, 24u8, 2u8, 32u8, 3u8, 40u8, 5u8, 82u8, 15u8, 101u8, 120u8, 116u8, 101u8, + 110u8, 115u8, 105u8, 111u8, 110u8, 78u8, 117u8, 109u8, 98u8, 101u8, 114u8, 34u8, + 89u8, 10u8, 19u8, 76u8, 105u8, 115u8, 116u8, 83u8, 101u8, 114u8, 118u8, 105u8, 99u8, + 101u8, 82u8, 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 18u8, 66u8, 10u8, 7u8, + 115u8, 101u8, 114u8, 118u8, 105u8, 99u8, 101u8, 24u8, 1u8, 32u8, 3u8, 40u8, 11u8, + 50u8, 40u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, 114u8, 101u8, 102u8, 108u8, 101u8, + 99u8, 116u8, 105u8, 111u8, 110u8, 46u8, 118u8, 49u8, 97u8, 108u8, 112u8, 104u8, 97u8, + 46u8, 83u8, 101u8, 114u8, 118u8, 105u8, 99u8, 101u8, 82u8, 101u8, 115u8, 112u8, + 111u8, 110u8, 115u8, 101u8, 82u8, 7u8, 115u8, 101u8, 114u8, 118u8, 105u8, 99u8, + 101u8, 34u8, 37u8, 10u8, 15u8, 83u8, 101u8, 114u8, 118u8, 105u8, 99u8, 101u8, 82u8, + 101u8, 115u8, 112u8, 111u8, 110u8, 115u8, 101u8, 18u8, 18u8, 10u8, 4u8, 110u8, 97u8, + 109u8, 101u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, 4u8, 110u8, 97u8, 109u8, 101u8, + 34u8, 83u8, 10u8, 13u8, 69u8, 114u8, 114u8, 111u8, 114u8, 82u8, 101u8, 115u8, 112u8, + 111u8, 110u8, 115u8, 101u8, 18u8, 29u8, 10u8, 10u8, 101u8, 114u8, 114u8, 111u8, + 114u8, 95u8, 99u8, 111u8, 100u8, 101u8, 24u8, 1u8, 32u8, 1u8, 40u8, 5u8, 82u8, 9u8, + 101u8, 114u8, 114u8, 111u8, 114u8, 67u8, 111u8, 100u8, 101u8, 18u8, 35u8, 10u8, 13u8, + 101u8, 114u8, 114u8, 111u8, 114u8, 95u8, 109u8, 101u8, 115u8, 115u8, 97u8, 103u8, + 101u8, 24u8, 2u8, 32u8, 1u8, 40u8, 9u8, 82u8, 12u8, 101u8, 114u8, 114u8, 111u8, + 114u8, 77u8, 101u8, 115u8, 115u8, 97u8, 103u8, 101u8, 50u8, 147u8, 1u8, 10u8, 16u8, + 83u8, 101u8, 114u8, 118u8, 101u8, 114u8, 82u8, 101u8, 102u8, 108u8, 101u8, 99u8, + 116u8, 105u8, 111u8, 110u8, 18u8, 127u8, 10u8, 20u8, 83u8, 101u8, 114u8, 118u8, + 101u8, 114u8, 82u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, + 73u8, 110u8, 102u8, 111u8, 18u8, 48u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, 114u8, + 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 46u8, 118u8, 49u8, + 97u8, 108u8, 112u8, 104u8, 97u8, 46u8, 83u8, 101u8, 114u8, 118u8, 101u8, 114u8, 82u8, + 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 82u8, 101u8, 113u8, + 117u8, 101u8, 115u8, 116u8, 26u8, 49u8, 46u8, 103u8, 114u8, 112u8, 99u8, 46u8, 114u8, + 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 46u8, 118u8, 49u8, + 97u8, 108u8, 112u8, 104u8, 97u8, 46u8, 83u8, 101u8, 114u8, 118u8, 101u8, 114u8, 82u8, + 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, 111u8, 110u8, 82u8, 101u8, 115u8, + 112u8, 111u8, 110u8, 115u8, 101u8, 40u8, 1u8, 48u8, 1u8, 98u8, 6u8, 112u8, 114u8, + 111u8, 116u8, 111u8, 51u8, ]; diff --git a/tonic-types/src/generated/types_fds.rs b/tonic-types/src/generated/types_fds.rs index f244f23af..865b7fcd8 100644 --- a/tonic-types/src/generated/types_fds.rs +++ b/tonic-types/src/generated/types_fds.rs @@ -1,2209 +1,176 @@ // This file is @generated by codegen. /// Byte encoded FILE_DESCRIPTOR_SET. pub const FILE_DESCRIPTOR_SET: &[u8] = &[ - 10u8, - 228u8, - 1u8, - 10u8, - 25u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 47u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 98u8, - 117u8, - 102u8, - 47u8, - 97u8, - 110u8, - 121u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 18u8, - 15u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 98u8, - 117u8, - 102u8, - 34u8, - 54u8, - 10u8, - 3u8, - 65u8, - 110u8, - 121u8, - 18u8, - 25u8, - 10u8, - 8u8, - 116u8, - 121u8, - 112u8, - 101u8, - 95u8, - 117u8, - 114u8, - 108u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 7u8, - 116u8, - 121u8, - 112u8, - 101u8, - 85u8, - 114u8, - 108u8, - 18u8, - 20u8, - 10u8, - 5u8, - 118u8, - 97u8, - 108u8, - 117u8, - 101u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 12u8, - 82u8, - 5u8, - 118u8, - 97u8, - 108u8, - 117u8, - 101u8, - 66u8, - 118u8, - 10u8, - 19u8, - 99u8, - 111u8, - 109u8, - 46u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 98u8, - 117u8, - 102u8, - 66u8, - 8u8, - 65u8, - 110u8, - 121u8, - 80u8, - 114u8, - 111u8, - 116u8, - 111u8, - 80u8, - 1u8, - 90u8, - 44u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 103u8, - 111u8, - 108u8, - 97u8, - 110u8, - 103u8, - 46u8, - 111u8, - 114u8, - 103u8, - 47u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 98u8, - 117u8, - 102u8, - 47u8, - 116u8, - 121u8, - 112u8, - 101u8, - 115u8, - 47u8, - 107u8, - 110u8, - 111u8, - 119u8, - 110u8, - 47u8, - 97u8, - 110u8, - 121u8, - 112u8, - 98u8, - 162u8, - 2u8, - 3u8, - 71u8, - 80u8, - 66u8, - 170u8, - 2u8, - 30u8, - 71u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 80u8, - 114u8, - 111u8, - 116u8, - 111u8, - 98u8, - 117u8, - 102u8, - 46u8, - 87u8, - 101u8, - 108u8, - 108u8, - 75u8, - 110u8, - 111u8, - 119u8, - 110u8, - 84u8, - 121u8, - 112u8, - 101u8, - 115u8, - 98u8, - 6u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 51u8, - 10u8, - 136u8, - 2u8, - 10u8, - 12u8, - 115u8, - 116u8, - 97u8, - 116u8, - 117u8, - 115u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 18u8, - 10u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 114u8, - 112u8, - 99u8, - 26u8, - 25u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 47u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 98u8, - 117u8, - 102u8, - 47u8, - 97u8, - 110u8, - 121u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 34u8, - 102u8, - 10u8, - 6u8, - 83u8, - 116u8, - 97u8, - 116u8, - 117u8, - 115u8, - 18u8, - 18u8, - 10u8, - 4u8, - 99u8, - 111u8, - 100u8, - 101u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 5u8, - 82u8, - 4u8, - 99u8, - 111u8, - 100u8, - 101u8, - 18u8, - 24u8, - 10u8, - 7u8, - 109u8, - 101u8, - 115u8, - 115u8, - 97u8, - 103u8, - 101u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 7u8, - 109u8, - 101u8, - 115u8, - 115u8, - 97u8, - 103u8, - 101u8, - 18u8, - 46u8, - 10u8, - 7u8, - 100u8, - 101u8, - 116u8, - 97u8, - 105u8, - 108u8, - 115u8, - 24u8, - 3u8, - 32u8, - 3u8, - 40u8, - 11u8, - 50u8, - 20u8, - 46u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 98u8, - 117u8, - 102u8, - 46u8, - 65u8, - 110u8, - 121u8, - 82u8, - 7u8, - 100u8, - 101u8, - 116u8, - 97u8, - 105u8, - 108u8, - 115u8, - 66u8, - 97u8, - 10u8, - 14u8, - 99u8, - 111u8, - 109u8, - 46u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 114u8, - 112u8, - 99u8, - 66u8, - 11u8, - 83u8, - 116u8, - 97u8, - 116u8, - 117u8, - 115u8, - 80u8, - 114u8, - 111u8, - 116u8, - 111u8, - 80u8, - 1u8, - 90u8, - 55u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 103u8, - 111u8, - 108u8, - 97u8, - 110u8, - 103u8, - 46u8, - 111u8, - 114u8, - 103u8, - 47u8, - 103u8, - 101u8, - 110u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 47u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 97u8, - 112u8, - 105u8, - 115u8, - 47u8, - 114u8, - 112u8, - 99u8, - 47u8, - 115u8, - 116u8, - 97u8, - 116u8, - 117u8, - 115u8, - 59u8, - 115u8, - 116u8, - 97u8, - 116u8, - 117u8, - 115u8, - 248u8, - 1u8, - 1u8, - 162u8, - 2u8, - 3u8, - 82u8, - 80u8, - 67u8, - 98u8, - 6u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 51u8, - 10u8, - 251u8, - 1u8, - 10u8, - 30u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 47u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 98u8, - 117u8, - 102u8, - 47u8, - 100u8, - 117u8, - 114u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 18u8, - 15u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 98u8, - 117u8, - 102u8, - 34u8, - 58u8, - 10u8, - 8u8, - 68u8, - 117u8, - 114u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 18u8, - 24u8, - 10u8, - 7u8, - 115u8, - 101u8, - 99u8, - 111u8, - 110u8, - 100u8, - 115u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 3u8, - 82u8, - 7u8, - 115u8, - 101u8, - 99u8, - 111u8, - 110u8, - 100u8, - 115u8, - 18u8, - 20u8, - 10u8, - 5u8, - 110u8, - 97u8, - 110u8, - 111u8, - 115u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 5u8, - 82u8, - 5u8, - 110u8, - 97u8, - 110u8, - 111u8, - 115u8, - 66u8, - 131u8, - 1u8, - 10u8, - 19u8, - 99u8, - 111u8, - 109u8, - 46u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 98u8, - 117u8, - 102u8, - 66u8, - 13u8, - 68u8, - 117u8, - 114u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 80u8, - 114u8, - 111u8, - 116u8, - 111u8, - 80u8, - 1u8, - 90u8, - 49u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 103u8, - 111u8, - 108u8, - 97u8, - 110u8, - 103u8, - 46u8, - 111u8, - 114u8, - 103u8, - 47u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 98u8, - 117u8, - 102u8, - 47u8, - 116u8, - 121u8, - 112u8, - 101u8, - 115u8, - 47u8, - 107u8, - 110u8, - 111u8, - 119u8, - 110u8, - 47u8, - 100u8, - 117u8, - 114u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 112u8, - 98u8, - 248u8, - 1u8, - 1u8, - 162u8, - 2u8, - 3u8, - 71u8, - 80u8, - 66u8, - 170u8, - 2u8, - 30u8, - 71u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 80u8, - 114u8, - 111u8, - 116u8, - 111u8, - 98u8, - 117u8, - 102u8, - 46u8, - 87u8, - 101u8, - 108u8, - 108u8, - 75u8, - 110u8, - 111u8, - 119u8, - 110u8, - 84u8, - 121u8, - 112u8, - 101u8, - 115u8, - 98u8, - 6u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 51u8, - 10u8, - 170u8, - 11u8, - 10u8, - 19u8, - 101u8, - 114u8, - 114u8, - 111u8, - 114u8, - 95u8, - 100u8, - 101u8, - 116u8, - 97u8, - 105u8, - 108u8, - 115u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 18u8, - 10u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 114u8, - 112u8, - 99u8, - 26u8, - 30u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 47u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 98u8, - 117u8, - 102u8, - 47u8, - 100u8, - 117u8, - 114u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 34u8, - 71u8, - 10u8, - 9u8, - 82u8, - 101u8, - 116u8, - 114u8, - 121u8, - 73u8, - 110u8, - 102u8, - 111u8, - 18u8, - 58u8, - 10u8, - 11u8, - 114u8, - 101u8, - 116u8, - 114u8, - 121u8, - 95u8, - 100u8, - 101u8, - 108u8, - 97u8, - 121u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 11u8, - 50u8, - 25u8, - 46u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 98u8, - 117u8, - 102u8, - 46u8, - 68u8, - 117u8, - 114u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 82u8, - 10u8, - 114u8, - 101u8, - 116u8, - 114u8, - 121u8, - 68u8, - 101u8, - 108u8, - 97u8, - 121u8, - 34u8, - 72u8, - 10u8, - 9u8, - 68u8, - 101u8, - 98u8, - 117u8, - 103u8, - 73u8, - 110u8, - 102u8, - 111u8, - 18u8, - 35u8, - 10u8, - 13u8, - 115u8, - 116u8, - 97u8, - 99u8, - 107u8, - 95u8, - 101u8, - 110u8, - 116u8, - 114u8, - 105u8, - 101u8, - 115u8, - 24u8, - 1u8, - 32u8, - 3u8, - 40u8, - 9u8, - 82u8, - 12u8, - 115u8, - 116u8, - 97u8, - 99u8, - 107u8, - 69u8, - 110u8, - 116u8, - 114u8, - 105u8, - 101u8, - 115u8, - 18u8, - 22u8, - 10u8, - 6u8, - 100u8, - 101u8, - 116u8, - 97u8, - 105u8, - 108u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 6u8, - 100u8, - 101u8, - 116u8, - 97u8, - 105u8, - 108u8, - 34u8, - 155u8, - 1u8, - 10u8, - 12u8, - 81u8, - 117u8, - 111u8, - 116u8, - 97u8, - 70u8, - 97u8, - 105u8, - 108u8, - 117u8, - 114u8, - 101u8, - 18u8, - 66u8, - 10u8, - 10u8, - 118u8, - 105u8, - 111u8, - 108u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 115u8, - 24u8, - 1u8, - 32u8, - 3u8, - 40u8, - 11u8, - 50u8, - 34u8, - 46u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 114u8, - 112u8, - 99u8, - 46u8, - 81u8, - 117u8, - 111u8, - 116u8, - 97u8, - 70u8, - 97u8, - 105u8, - 108u8, - 117u8, - 114u8, - 101u8, - 46u8, - 86u8, - 105u8, - 111u8, - 108u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 82u8, - 10u8, - 118u8, - 105u8, - 111u8, - 108u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 115u8, - 26u8, - 71u8, - 10u8, - 9u8, - 86u8, - 105u8, - 111u8, - 108u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 18u8, - 24u8, - 10u8, - 7u8, - 115u8, - 117u8, - 98u8, - 106u8, - 101u8, - 99u8, - 116u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 7u8, - 115u8, - 117u8, - 98u8, - 106u8, - 101u8, - 99u8, - 116u8, - 18u8, - 32u8, - 10u8, - 11u8, - 100u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 105u8, - 111u8, - 110u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 11u8, - 100u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 105u8, - 111u8, - 110u8, - 34u8, - 185u8, - 1u8, - 10u8, - 9u8, - 69u8, - 114u8, - 114u8, - 111u8, - 114u8, - 73u8, - 110u8, - 102u8, - 111u8, - 18u8, - 22u8, - 10u8, - 6u8, - 114u8, - 101u8, - 97u8, - 115u8, - 111u8, - 110u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 6u8, - 114u8, - 101u8, - 97u8, - 115u8, - 111u8, - 110u8, - 18u8, - 22u8, - 10u8, - 6u8, - 100u8, - 111u8, - 109u8, - 97u8, - 105u8, - 110u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 6u8, - 100u8, - 111u8, - 109u8, - 97u8, - 105u8, - 110u8, - 18u8, - 63u8, - 10u8, - 8u8, - 109u8, - 101u8, - 116u8, - 97u8, - 100u8, - 97u8, - 116u8, - 97u8, - 24u8, - 3u8, - 32u8, - 3u8, - 40u8, - 11u8, - 50u8, - 35u8, - 46u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 114u8, - 112u8, - 99u8, - 46u8, - 69u8, - 114u8, - 114u8, - 111u8, - 114u8, - 73u8, - 110u8, - 102u8, - 111u8, - 46u8, - 77u8, - 101u8, - 116u8, - 97u8, - 100u8, - 97u8, - 116u8, - 97u8, - 69u8, - 110u8, - 116u8, - 114u8, - 121u8, - 82u8, - 8u8, - 109u8, - 101u8, - 116u8, - 97u8, - 100u8, - 97u8, - 116u8, - 97u8, - 26u8, - 59u8, - 10u8, - 13u8, - 77u8, - 101u8, - 116u8, - 97u8, - 100u8, - 97u8, - 116u8, - 97u8, - 69u8, - 110u8, - 116u8, - 114u8, - 121u8, - 18u8, - 16u8, - 10u8, - 3u8, - 107u8, - 101u8, - 121u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 3u8, - 107u8, - 101u8, - 121u8, - 18u8, - 20u8, - 10u8, - 5u8, - 118u8, - 97u8, - 108u8, - 117u8, - 101u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 5u8, - 118u8, - 97u8, - 108u8, - 117u8, - 101u8, - 58u8, - 2u8, - 56u8, - 1u8, - 34u8, - 189u8, - 1u8, - 10u8, - 19u8, - 80u8, - 114u8, - 101u8, - 99u8, - 111u8, - 110u8, - 100u8, - 105u8, - 116u8, - 105u8, - 111u8, - 110u8, - 70u8, - 97u8, - 105u8, - 108u8, - 117u8, - 114u8, - 101u8, - 18u8, - 73u8, - 10u8, - 10u8, - 118u8, - 105u8, - 111u8, - 108u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 115u8, - 24u8, - 1u8, - 32u8, - 3u8, - 40u8, - 11u8, - 50u8, - 41u8, - 46u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 114u8, - 112u8, - 99u8, - 46u8, - 80u8, - 114u8, - 101u8, - 99u8, - 111u8, - 110u8, - 100u8, - 105u8, - 116u8, - 105u8, - 111u8, - 110u8, - 70u8, - 97u8, - 105u8, - 108u8, - 117u8, - 114u8, - 101u8, - 46u8, - 86u8, - 105u8, - 111u8, - 108u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 82u8, - 10u8, - 118u8, - 105u8, - 111u8, - 108u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 115u8, - 26u8, - 91u8, - 10u8, - 9u8, - 86u8, - 105u8, - 111u8, - 108u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 18u8, - 18u8, - 10u8, - 4u8, - 116u8, - 121u8, - 112u8, - 101u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 4u8, - 116u8, - 121u8, - 112u8, - 101u8, - 18u8, - 24u8, - 10u8, - 7u8, - 115u8, - 117u8, - 98u8, - 106u8, - 101u8, - 99u8, - 116u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 7u8, - 115u8, - 117u8, - 98u8, - 106u8, - 101u8, - 99u8, - 116u8, - 18u8, - 32u8, - 10u8, - 11u8, - 100u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 105u8, - 111u8, - 110u8, - 24u8, - 3u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 11u8, - 100u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 105u8, - 111u8, - 110u8, - 34u8, - 168u8, - 1u8, - 10u8, - 10u8, - 66u8, - 97u8, - 100u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 18u8, - 80u8, - 10u8, - 16u8, - 102u8, - 105u8, - 101u8, - 108u8, - 100u8, - 95u8, - 118u8, - 105u8, - 111u8, - 108u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 115u8, - 24u8, - 1u8, - 32u8, - 3u8, - 40u8, - 11u8, - 50u8, - 37u8, - 46u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 114u8, - 112u8, - 99u8, - 46u8, - 66u8, - 97u8, - 100u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 46u8, - 70u8, - 105u8, - 101u8, - 108u8, - 100u8, - 86u8, - 105u8, - 111u8, - 108u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 82u8, - 15u8, - 102u8, - 105u8, - 101u8, - 108u8, - 100u8, - 86u8, - 105u8, - 111u8, - 108u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 115u8, - 26u8, - 72u8, - 10u8, - 14u8, - 70u8, - 105u8, - 101u8, - 108u8, - 100u8, - 86u8, - 105u8, - 111u8, - 108u8, - 97u8, - 116u8, - 105u8, - 111u8, - 110u8, - 18u8, - 20u8, - 10u8, - 5u8, - 102u8, - 105u8, - 101u8, - 108u8, - 100u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 5u8, - 102u8, - 105u8, - 101u8, - 108u8, - 100u8, - 18u8, - 32u8, - 10u8, - 11u8, - 100u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 105u8, - 111u8, - 110u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 11u8, - 100u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 105u8, - 111u8, - 110u8, - 34u8, - 79u8, - 10u8, - 11u8, - 82u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 73u8, - 110u8, - 102u8, - 111u8, - 18u8, - 29u8, - 10u8, - 10u8, - 114u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 95u8, - 105u8, - 100u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 9u8, - 114u8, - 101u8, - 113u8, - 117u8, - 101u8, - 115u8, - 116u8, - 73u8, - 100u8, - 18u8, - 33u8, - 10u8, - 12u8, - 115u8, - 101u8, - 114u8, - 118u8, - 105u8, - 110u8, - 103u8, - 95u8, - 100u8, - 97u8, - 116u8, - 97u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 11u8, - 115u8, - 101u8, - 114u8, - 118u8, - 105u8, - 110u8, - 103u8, - 68u8, - 97u8, - 116u8, - 97u8, - 34u8, - 144u8, - 1u8, - 10u8, - 12u8, - 82u8, - 101u8, - 115u8, - 111u8, - 117u8, - 114u8, - 99u8, - 101u8, - 73u8, - 110u8, - 102u8, - 111u8, - 18u8, - 35u8, - 10u8, - 13u8, - 114u8, - 101u8, - 115u8, - 111u8, - 117u8, - 114u8, - 99u8, - 101u8, - 95u8, - 116u8, - 121u8, - 112u8, - 101u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 12u8, - 114u8, - 101u8, - 115u8, - 111u8, - 117u8, - 114u8, - 99u8, - 101u8, - 84u8, - 121u8, - 112u8, - 101u8, - 18u8, - 35u8, - 10u8, - 13u8, - 114u8, - 101u8, - 115u8, - 111u8, - 117u8, - 114u8, - 99u8, - 101u8, - 95u8, - 110u8, - 97u8, - 109u8, - 101u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 12u8, - 114u8, - 101u8, - 115u8, - 111u8, - 117u8, - 114u8, - 99u8, - 101u8, - 78u8, - 97u8, - 109u8, - 101u8, - 18u8, - 20u8, - 10u8, - 5u8, - 111u8, - 119u8, - 110u8, - 101u8, - 114u8, - 24u8, - 3u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 5u8, - 111u8, - 119u8, - 110u8, - 101u8, - 114u8, - 18u8, - 32u8, - 10u8, - 11u8, - 100u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 105u8, - 111u8, - 110u8, - 24u8, - 4u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 11u8, - 100u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 105u8, - 111u8, - 110u8, - 34u8, - 111u8, - 10u8, - 4u8, - 72u8, - 101u8, - 108u8, - 112u8, - 18u8, - 43u8, - 10u8, - 5u8, - 108u8, - 105u8, - 110u8, - 107u8, - 115u8, - 24u8, - 1u8, - 32u8, - 3u8, - 40u8, - 11u8, - 50u8, - 21u8, - 46u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 114u8, - 112u8, - 99u8, - 46u8, - 72u8, - 101u8, - 108u8, - 112u8, - 46u8, - 76u8, - 105u8, - 110u8, - 107u8, - 82u8, - 5u8, - 108u8, - 105u8, - 110u8, - 107u8, - 115u8, - 26u8, - 58u8, - 10u8, - 4u8, - 76u8, - 105u8, - 110u8, - 107u8, - 18u8, - 32u8, - 10u8, - 11u8, - 100u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 105u8, - 111u8, - 110u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 11u8, - 100u8, - 101u8, - 115u8, - 99u8, - 114u8, - 105u8, - 112u8, - 116u8, - 105u8, - 111u8, - 110u8, - 18u8, - 16u8, - 10u8, - 3u8, - 117u8, - 114u8, - 108u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 3u8, - 117u8, - 114u8, - 108u8, - 34u8, - 68u8, - 10u8, - 16u8, - 76u8, - 111u8, - 99u8, - 97u8, - 108u8, - 105u8, - 122u8, - 101u8, - 100u8, - 77u8, - 101u8, - 115u8, - 115u8, - 97u8, - 103u8, - 101u8, - 18u8, - 22u8, - 10u8, - 6u8, - 108u8, - 111u8, - 99u8, - 97u8, - 108u8, - 101u8, - 24u8, - 1u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 6u8, - 108u8, - 111u8, - 99u8, - 97u8, - 108u8, - 101u8, - 18u8, - 24u8, - 10u8, - 7u8, - 109u8, - 101u8, - 115u8, - 115u8, - 97u8, - 103u8, - 101u8, - 24u8, - 2u8, - 32u8, - 1u8, - 40u8, - 9u8, - 82u8, - 7u8, - 109u8, - 101u8, - 115u8, - 115u8, - 97u8, - 103u8, - 101u8, - 66u8, - 108u8, - 10u8, - 14u8, - 99u8, - 111u8, - 109u8, - 46u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 114u8, - 112u8, - 99u8, - 66u8, - 17u8, - 69u8, - 114u8, - 114u8, - 111u8, - 114u8, - 68u8, - 101u8, - 116u8, - 97u8, - 105u8, - 108u8, - 115u8, - 80u8, - 114u8, - 111u8, - 116u8, - 111u8, - 80u8, - 1u8, - 90u8, - 63u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 46u8, - 103u8, - 111u8, - 108u8, - 97u8, - 110u8, - 103u8, - 46u8, - 111u8, - 114u8, - 103u8, - 47u8, - 103u8, - 101u8, - 110u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 47u8, - 103u8, - 111u8, - 111u8, - 103u8, - 108u8, - 101u8, - 97u8, - 112u8, - 105u8, - 115u8, - 47u8, - 114u8, - 112u8, - 99u8, - 47u8, - 101u8, - 114u8, - 114u8, - 100u8, - 101u8, - 116u8, - 97u8, - 105u8, - 108u8, - 115u8, - 59u8, - 101u8, - 114u8, - 114u8, - 100u8, - 101u8, - 116u8, - 97u8, - 105u8, - 108u8, - 115u8, - 162u8, - 2u8, - 3u8, - 82u8, - 80u8, - 67u8, - 98u8, - 6u8, - 112u8, - 114u8, - 111u8, - 116u8, - 111u8, - 51u8, + 10u8, 228u8, 1u8, 10u8, 25u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, 47u8, 112u8, + 114u8, 111u8, 116u8, 111u8, 98u8, 117u8, 102u8, 47u8, 97u8, 110u8, 121u8, 46u8, + 112u8, 114u8, 111u8, 116u8, 111u8, 18u8, 15u8, 103u8, 111u8, 111u8, 103u8, 108u8, + 101u8, 46u8, 112u8, 114u8, 111u8, 116u8, 111u8, 98u8, 117u8, 102u8, 34u8, 54u8, 10u8, + 3u8, 65u8, 110u8, 121u8, 18u8, 25u8, 10u8, 8u8, 116u8, 121u8, 112u8, 101u8, 95u8, + 117u8, 114u8, 108u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, 7u8, 116u8, 121u8, 112u8, + 101u8, 85u8, 114u8, 108u8, 18u8, 20u8, 10u8, 5u8, 118u8, 97u8, 108u8, 117u8, 101u8, + 24u8, 2u8, 32u8, 1u8, 40u8, 12u8, 82u8, 5u8, 118u8, 97u8, 108u8, 117u8, 101u8, 66u8, + 118u8, 10u8, 19u8, 99u8, 111u8, 109u8, 46u8, 103u8, 111u8, 111u8, 103u8, 108u8, + 101u8, 46u8, 112u8, 114u8, 111u8, 116u8, 111u8, 98u8, 117u8, 102u8, 66u8, 8u8, 65u8, + 110u8, 121u8, 80u8, 114u8, 111u8, 116u8, 111u8, 80u8, 1u8, 90u8, 44u8, 103u8, 111u8, + 111u8, 103u8, 108u8, 101u8, 46u8, 103u8, 111u8, 108u8, 97u8, 110u8, 103u8, 46u8, + 111u8, 114u8, 103u8, 47u8, 112u8, 114u8, 111u8, 116u8, 111u8, 98u8, 117u8, 102u8, + 47u8, 116u8, 121u8, 112u8, 101u8, 115u8, 47u8, 107u8, 110u8, 111u8, 119u8, 110u8, + 47u8, 97u8, 110u8, 121u8, 112u8, 98u8, 162u8, 2u8, 3u8, 71u8, 80u8, 66u8, 170u8, 2u8, + 30u8, 71u8, 111u8, 111u8, 103u8, 108u8, 101u8, 46u8, 80u8, 114u8, 111u8, 116u8, + 111u8, 98u8, 117u8, 102u8, 46u8, 87u8, 101u8, 108u8, 108u8, 75u8, 110u8, 111u8, + 119u8, 110u8, 84u8, 121u8, 112u8, 101u8, 115u8, 98u8, 6u8, 112u8, 114u8, 111u8, + 116u8, 111u8, 51u8, 10u8, 136u8, 2u8, 10u8, 12u8, 115u8, 116u8, 97u8, 116u8, 117u8, + 115u8, 46u8, 112u8, 114u8, 111u8, 116u8, 111u8, 18u8, 10u8, 103u8, 111u8, 111u8, + 103u8, 108u8, 101u8, 46u8, 114u8, 112u8, 99u8, 26u8, 25u8, 103u8, 111u8, 111u8, + 103u8, 108u8, 101u8, 47u8, 112u8, 114u8, 111u8, 116u8, 111u8, 98u8, 117u8, 102u8, + 47u8, 97u8, 110u8, 121u8, 46u8, 112u8, 114u8, 111u8, 116u8, 111u8, 34u8, 102u8, 10u8, + 6u8, 83u8, 116u8, 97u8, 116u8, 117u8, 115u8, 18u8, 18u8, 10u8, 4u8, 99u8, 111u8, + 100u8, 101u8, 24u8, 1u8, 32u8, 1u8, 40u8, 5u8, 82u8, 4u8, 99u8, 111u8, 100u8, 101u8, + 18u8, 24u8, 10u8, 7u8, 109u8, 101u8, 115u8, 115u8, 97u8, 103u8, 101u8, 24u8, 2u8, + 32u8, 1u8, 40u8, 9u8, 82u8, 7u8, 109u8, 101u8, 115u8, 115u8, 97u8, 103u8, 101u8, + 18u8, 46u8, 10u8, 7u8, 100u8, 101u8, 116u8, 97u8, 105u8, 108u8, 115u8, 24u8, 3u8, + 32u8, 3u8, 40u8, 11u8, 50u8, 20u8, 46u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, + 46u8, 112u8, 114u8, 111u8, 116u8, 111u8, 98u8, 117u8, 102u8, 46u8, 65u8, 110u8, + 121u8, 82u8, 7u8, 100u8, 101u8, 116u8, 97u8, 105u8, 108u8, 115u8, 66u8, 97u8, 10u8, + 14u8, 99u8, 111u8, 109u8, 46u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, 46u8, + 114u8, 112u8, 99u8, 66u8, 11u8, 83u8, 116u8, 97u8, 116u8, 117u8, 115u8, 80u8, 114u8, + 111u8, 116u8, 111u8, 80u8, 1u8, 90u8, 55u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, + 46u8, 103u8, 111u8, 108u8, 97u8, 110u8, 103u8, 46u8, 111u8, 114u8, 103u8, 47u8, + 103u8, 101u8, 110u8, 112u8, 114u8, 111u8, 116u8, 111u8, 47u8, 103u8, 111u8, 111u8, + 103u8, 108u8, 101u8, 97u8, 112u8, 105u8, 115u8, 47u8, 114u8, 112u8, 99u8, 47u8, + 115u8, 116u8, 97u8, 116u8, 117u8, 115u8, 59u8, 115u8, 116u8, 97u8, 116u8, 117u8, + 115u8, 248u8, 1u8, 1u8, 162u8, 2u8, 3u8, 82u8, 80u8, 67u8, 98u8, 6u8, 112u8, 114u8, + 111u8, 116u8, 111u8, 51u8, 10u8, 251u8, 1u8, 10u8, 30u8, 103u8, 111u8, 111u8, 103u8, + 108u8, 101u8, 47u8, 112u8, 114u8, 111u8, 116u8, 111u8, 98u8, 117u8, 102u8, 47u8, + 100u8, 117u8, 114u8, 97u8, 116u8, 105u8, 111u8, 110u8, 46u8, 112u8, 114u8, 111u8, + 116u8, 111u8, 18u8, 15u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, 46u8, 112u8, + 114u8, 111u8, 116u8, 111u8, 98u8, 117u8, 102u8, 34u8, 58u8, 10u8, 8u8, 68u8, 117u8, + 114u8, 97u8, 116u8, 105u8, 111u8, 110u8, 18u8, 24u8, 10u8, 7u8, 115u8, 101u8, 99u8, + 111u8, 110u8, 100u8, 115u8, 24u8, 1u8, 32u8, 1u8, 40u8, 3u8, 82u8, 7u8, 115u8, 101u8, + 99u8, 111u8, 110u8, 100u8, 115u8, 18u8, 20u8, 10u8, 5u8, 110u8, 97u8, 110u8, 111u8, + 115u8, 24u8, 2u8, 32u8, 1u8, 40u8, 5u8, 82u8, 5u8, 110u8, 97u8, 110u8, 111u8, 115u8, + 66u8, 131u8, 1u8, 10u8, 19u8, 99u8, 111u8, 109u8, 46u8, 103u8, 111u8, 111u8, 103u8, + 108u8, 101u8, 46u8, 112u8, 114u8, 111u8, 116u8, 111u8, 98u8, 117u8, 102u8, 66u8, + 13u8, 68u8, 117u8, 114u8, 97u8, 116u8, 105u8, 111u8, 110u8, 80u8, 114u8, 111u8, + 116u8, 111u8, 80u8, 1u8, 90u8, 49u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, 46u8, + 103u8, 111u8, 108u8, 97u8, 110u8, 103u8, 46u8, 111u8, 114u8, 103u8, 47u8, 112u8, + 114u8, 111u8, 116u8, 111u8, 98u8, 117u8, 102u8, 47u8, 116u8, 121u8, 112u8, 101u8, + 115u8, 47u8, 107u8, 110u8, 111u8, 119u8, 110u8, 47u8, 100u8, 117u8, 114u8, 97u8, + 116u8, 105u8, 111u8, 110u8, 112u8, 98u8, 248u8, 1u8, 1u8, 162u8, 2u8, 3u8, 71u8, + 80u8, 66u8, 170u8, 2u8, 30u8, 71u8, 111u8, 111u8, 103u8, 108u8, 101u8, 46u8, 80u8, + 114u8, 111u8, 116u8, 111u8, 98u8, 117u8, 102u8, 46u8, 87u8, 101u8, 108u8, 108u8, + 75u8, 110u8, 111u8, 119u8, 110u8, 84u8, 121u8, 112u8, 101u8, 115u8, 98u8, 6u8, 112u8, + 114u8, 111u8, 116u8, 111u8, 51u8, 10u8, 170u8, 11u8, 10u8, 19u8, 101u8, 114u8, 114u8, + 111u8, 114u8, 95u8, 100u8, 101u8, 116u8, 97u8, 105u8, 108u8, 115u8, 46u8, 112u8, + 114u8, 111u8, 116u8, 111u8, 18u8, 10u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, + 46u8, 114u8, 112u8, 99u8, 26u8, 30u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, 47u8, + 112u8, 114u8, 111u8, 116u8, 111u8, 98u8, 117u8, 102u8, 47u8, 100u8, 117u8, 114u8, + 97u8, 116u8, 105u8, 111u8, 110u8, 46u8, 112u8, 114u8, 111u8, 116u8, 111u8, 34u8, + 71u8, 10u8, 9u8, 82u8, 101u8, 116u8, 114u8, 121u8, 73u8, 110u8, 102u8, 111u8, 18u8, + 58u8, 10u8, 11u8, 114u8, 101u8, 116u8, 114u8, 121u8, 95u8, 100u8, 101u8, 108u8, 97u8, + 121u8, 24u8, 1u8, 32u8, 1u8, 40u8, 11u8, 50u8, 25u8, 46u8, 103u8, 111u8, 111u8, + 103u8, 108u8, 101u8, 46u8, 112u8, 114u8, 111u8, 116u8, 111u8, 98u8, 117u8, 102u8, + 46u8, 68u8, 117u8, 114u8, 97u8, 116u8, 105u8, 111u8, 110u8, 82u8, 10u8, 114u8, 101u8, + 116u8, 114u8, 121u8, 68u8, 101u8, 108u8, 97u8, 121u8, 34u8, 72u8, 10u8, 9u8, 68u8, + 101u8, 98u8, 117u8, 103u8, 73u8, 110u8, 102u8, 111u8, 18u8, 35u8, 10u8, 13u8, 115u8, + 116u8, 97u8, 99u8, 107u8, 95u8, 101u8, 110u8, 116u8, 114u8, 105u8, 101u8, 115u8, + 24u8, 1u8, 32u8, 3u8, 40u8, 9u8, 82u8, 12u8, 115u8, 116u8, 97u8, 99u8, 107u8, 69u8, + 110u8, 116u8, 114u8, 105u8, 101u8, 115u8, 18u8, 22u8, 10u8, 6u8, 100u8, 101u8, 116u8, + 97u8, 105u8, 108u8, 24u8, 2u8, 32u8, 1u8, 40u8, 9u8, 82u8, 6u8, 100u8, 101u8, 116u8, + 97u8, 105u8, 108u8, 34u8, 155u8, 1u8, 10u8, 12u8, 81u8, 117u8, 111u8, 116u8, 97u8, + 70u8, 97u8, 105u8, 108u8, 117u8, 114u8, 101u8, 18u8, 66u8, 10u8, 10u8, 118u8, 105u8, + 111u8, 108u8, 97u8, 116u8, 105u8, 111u8, 110u8, 115u8, 24u8, 1u8, 32u8, 3u8, 40u8, + 11u8, 50u8, 34u8, 46u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, 46u8, 114u8, 112u8, + 99u8, 46u8, 81u8, 117u8, 111u8, 116u8, 97u8, 70u8, 97u8, 105u8, 108u8, 117u8, 114u8, + 101u8, 46u8, 86u8, 105u8, 111u8, 108u8, 97u8, 116u8, 105u8, 111u8, 110u8, 82u8, 10u8, + 118u8, 105u8, 111u8, 108u8, 97u8, 116u8, 105u8, 111u8, 110u8, 115u8, 26u8, 71u8, + 10u8, 9u8, 86u8, 105u8, 111u8, 108u8, 97u8, 116u8, 105u8, 111u8, 110u8, 18u8, 24u8, + 10u8, 7u8, 115u8, 117u8, 98u8, 106u8, 101u8, 99u8, 116u8, 24u8, 1u8, 32u8, 1u8, 40u8, + 9u8, 82u8, 7u8, 115u8, 117u8, 98u8, 106u8, 101u8, 99u8, 116u8, 18u8, 32u8, 10u8, + 11u8, 100u8, 101u8, 115u8, 99u8, 114u8, 105u8, 112u8, 116u8, 105u8, 111u8, 110u8, + 24u8, 2u8, 32u8, 1u8, 40u8, 9u8, 82u8, 11u8, 100u8, 101u8, 115u8, 99u8, 114u8, 105u8, + 112u8, 116u8, 105u8, 111u8, 110u8, 34u8, 185u8, 1u8, 10u8, 9u8, 69u8, 114u8, 114u8, + 111u8, 114u8, 73u8, 110u8, 102u8, 111u8, 18u8, 22u8, 10u8, 6u8, 114u8, 101u8, 97u8, + 115u8, 111u8, 110u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, 6u8, 114u8, 101u8, 97u8, + 115u8, 111u8, 110u8, 18u8, 22u8, 10u8, 6u8, 100u8, 111u8, 109u8, 97u8, 105u8, 110u8, + 24u8, 2u8, 32u8, 1u8, 40u8, 9u8, 82u8, 6u8, 100u8, 111u8, 109u8, 97u8, 105u8, 110u8, + 18u8, 63u8, 10u8, 8u8, 109u8, 101u8, 116u8, 97u8, 100u8, 97u8, 116u8, 97u8, 24u8, + 3u8, 32u8, 3u8, 40u8, 11u8, 50u8, 35u8, 46u8, 103u8, 111u8, 111u8, 103u8, 108u8, + 101u8, 46u8, 114u8, 112u8, 99u8, 46u8, 69u8, 114u8, 114u8, 111u8, 114u8, 73u8, 110u8, + 102u8, 111u8, 46u8, 77u8, 101u8, 116u8, 97u8, 100u8, 97u8, 116u8, 97u8, 69u8, 110u8, + 116u8, 114u8, 121u8, 82u8, 8u8, 109u8, 101u8, 116u8, 97u8, 100u8, 97u8, 116u8, 97u8, + 26u8, 59u8, 10u8, 13u8, 77u8, 101u8, 116u8, 97u8, 100u8, 97u8, 116u8, 97u8, 69u8, + 110u8, 116u8, 114u8, 121u8, 18u8, 16u8, 10u8, 3u8, 107u8, 101u8, 121u8, 24u8, 1u8, + 32u8, 1u8, 40u8, 9u8, 82u8, 3u8, 107u8, 101u8, 121u8, 18u8, 20u8, 10u8, 5u8, 118u8, + 97u8, 108u8, 117u8, 101u8, 24u8, 2u8, 32u8, 1u8, 40u8, 9u8, 82u8, 5u8, 118u8, 97u8, + 108u8, 117u8, 101u8, 58u8, 2u8, 56u8, 1u8, 34u8, 189u8, 1u8, 10u8, 19u8, 80u8, 114u8, + 101u8, 99u8, 111u8, 110u8, 100u8, 105u8, 116u8, 105u8, 111u8, 110u8, 70u8, 97u8, + 105u8, 108u8, 117u8, 114u8, 101u8, 18u8, 73u8, 10u8, 10u8, 118u8, 105u8, 111u8, + 108u8, 97u8, 116u8, 105u8, 111u8, 110u8, 115u8, 24u8, 1u8, 32u8, 3u8, 40u8, 11u8, + 50u8, 41u8, 46u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, 46u8, 114u8, 112u8, 99u8, + 46u8, 80u8, 114u8, 101u8, 99u8, 111u8, 110u8, 100u8, 105u8, 116u8, 105u8, 111u8, + 110u8, 70u8, 97u8, 105u8, 108u8, 117u8, 114u8, 101u8, 46u8, 86u8, 105u8, 111u8, + 108u8, 97u8, 116u8, 105u8, 111u8, 110u8, 82u8, 10u8, 118u8, 105u8, 111u8, 108u8, + 97u8, 116u8, 105u8, 111u8, 110u8, 115u8, 26u8, 91u8, 10u8, 9u8, 86u8, 105u8, 111u8, + 108u8, 97u8, 116u8, 105u8, 111u8, 110u8, 18u8, 18u8, 10u8, 4u8, 116u8, 121u8, 112u8, + 101u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, 4u8, 116u8, 121u8, 112u8, 101u8, 18u8, + 24u8, 10u8, 7u8, 115u8, 117u8, 98u8, 106u8, 101u8, 99u8, 116u8, 24u8, 2u8, 32u8, 1u8, + 40u8, 9u8, 82u8, 7u8, 115u8, 117u8, 98u8, 106u8, 101u8, 99u8, 116u8, 18u8, 32u8, + 10u8, 11u8, 100u8, 101u8, 115u8, 99u8, 114u8, 105u8, 112u8, 116u8, 105u8, 111u8, + 110u8, 24u8, 3u8, 32u8, 1u8, 40u8, 9u8, 82u8, 11u8, 100u8, 101u8, 115u8, 99u8, 114u8, + 105u8, 112u8, 116u8, 105u8, 111u8, 110u8, 34u8, 168u8, 1u8, 10u8, 10u8, 66u8, 97u8, + 100u8, 82u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, 18u8, 80u8, 10u8, 16u8, 102u8, + 105u8, 101u8, 108u8, 100u8, 95u8, 118u8, 105u8, 111u8, 108u8, 97u8, 116u8, 105u8, + 111u8, 110u8, 115u8, 24u8, 1u8, 32u8, 3u8, 40u8, 11u8, 50u8, 37u8, 46u8, 103u8, + 111u8, 111u8, 103u8, 108u8, 101u8, 46u8, 114u8, 112u8, 99u8, 46u8, 66u8, 97u8, 100u8, + 82u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, 46u8, 70u8, 105u8, 101u8, 108u8, + 100u8, 86u8, 105u8, 111u8, 108u8, 97u8, 116u8, 105u8, 111u8, 110u8, 82u8, 15u8, + 102u8, 105u8, 101u8, 108u8, 100u8, 86u8, 105u8, 111u8, 108u8, 97u8, 116u8, 105u8, + 111u8, 110u8, 115u8, 26u8, 72u8, 10u8, 14u8, 70u8, 105u8, 101u8, 108u8, 100u8, 86u8, + 105u8, 111u8, 108u8, 97u8, 116u8, 105u8, 111u8, 110u8, 18u8, 20u8, 10u8, 5u8, 102u8, + 105u8, 101u8, 108u8, 100u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, 5u8, 102u8, 105u8, + 101u8, 108u8, 100u8, 18u8, 32u8, 10u8, 11u8, 100u8, 101u8, 115u8, 99u8, 114u8, 105u8, + 112u8, 116u8, 105u8, 111u8, 110u8, 24u8, 2u8, 32u8, 1u8, 40u8, 9u8, 82u8, 11u8, + 100u8, 101u8, 115u8, 99u8, 114u8, 105u8, 112u8, 116u8, 105u8, 111u8, 110u8, 34u8, + 79u8, 10u8, 11u8, 82u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, 73u8, 110u8, 102u8, + 111u8, 18u8, 29u8, 10u8, 10u8, 114u8, 101u8, 113u8, 117u8, 101u8, 115u8, 116u8, 95u8, + 105u8, 100u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, 9u8, 114u8, 101u8, 113u8, 117u8, + 101u8, 115u8, 116u8, 73u8, 100u8, 18u8, 33u8, 10u8, 12u8, 115u8, 101u8, 114u8, 118u8, + 105u8, 110u8, 103u8, 95u8, 100u8, 97u8, 116u8, 97u8, 24u8, 2u8, 32u8, 1u8, 40u8, 9u8, + 82u8, 11u8, 115u8, 101u8, 114u8, 118u8, 105u8, 110u8, 103u8, 68u8, 97u8, 116u8, 97u8, + 34u8, 144u8, 1u8, 10u8, 12u8, 82u8, 101u8, 115u8, 111u8, 117u8, 114u8, 99u8, 101u8, + 73u8, 110u8, 102u8, 111u8, 18u8, 35u8, 10u8, 13u8, 114u8, 101u8, 115u8, 111u8, 117u8, + 114u8, 99u8, 101u8, 95u8, 116u8, 121u8, 112u8, 101u8, 24u8, 1u8, 32u8, 1u8, 40u8, + 9u8, 82u8, 12u8, 114u8, 101u8, 115u8, 111u8, 117u8, 114u8, 99u8, 101u8, 84u8, 121u8, + 112u8, 101u8, 18u8, 35u8, 10u8, 13u8, 114u8, 101u8, 115u8, 111u8, 117u8, 114u8, 99u8, + 101u8, 95u8, 110u8, 97u8, 109u8, 101u8, 24u8, 2u8, 32u8, 1u8, 40u8, 9u8, 82u8, 12u8, + 114u8, 101u8, 115u8, 111u8, 117u8, 114u8, 99u8, 101u8, 78u8, 97u8, 109u8, 101u8, + 18u8, 20u8, 10u8, 5u8, 111u8, 119u8, 110u8, 101u8, 114u8, 24u8, 3u8, 32u8, 1u8, 40u8, + 9u8, 82u8, 5u8, 111u8, 119u8, 110u8, 101u8, 114u8, 18u8, 32u8, 10u8, 11u8, 100u8, + 101u8, 115u8, 99u8, 114u8, 105u8, 112u8, 116u8, 105u8, 111u8, 110u8, 24u8, 4u8, 32u8, + 1u8, 40u8, 9u8, 82u8, 11u8, 100u8, 101u8, 115u8, 99u8, 114u8, 105u8, 112u8, 116u8, + 105u8, 111u8, 110u8, 34u8, 111u8, 10u8, 4u8, 72u8, 101u8, 108u8, 112u8, 18u8, 43u8, + 10u8, 5u8, 108u8, 105u8, 110u8, 107u8, 115u8, 24u8, 1u8, 32u8, 3u8, 40u8, 11u8, 50u8, + 21u8, 46u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, 46u8, 114u8, 112u8, 99u8, 46u8, + 72u8, 101u8, 108u8, 112u8, 46u8, 76u8, 105u8, 110u8, 107u8, 82u8, 5u8, 108u8, 105u8, + 110u8, 107u8, 115u8, 26u8, 58u8, 10u8, 4u8, 76u8, 105u8, 110u8, 107u8, 18u8, 32u8, + 10u8, 11u8, 100u8, 101u8, 115u8, 99u8, 114u8, 105u8, 112u8, 116u8, 105u8, 111u8, + 110u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, 11u8, 100u8, 101u8, 115u8, 99u8, 114u8, + 105u8, 112u8, 116u8, 105u8, 111u8, 110u8, 18u8, 16u8, 10u8, 3u8, 117u8, 114u8, 108u8, + 24u8, 2u8, 32u8, 1u8, 40u8, 9u8, 82u8, 3u8, 117u8, 114u8, 108u8, 34u8, 68u8, 10u8, + 16u8, 76u8, 111u8, 99u8, 97u8, 108u8, 105u8, 122u8, 101u8, 100u8, 77u8, 101u8, 115u8, + 115u8, 97u8, 103u8, 101u8, 18u8, 22u8, 10u8, 6u8, 108u8, 111u8, 99u8, 97u8, 108u8, + 101u8, 24u8, 1u8, 32u8, 1u8, 40u8, 9u8, 82u8, 6u8, 108u8, 111u8, 99u8, 97u8, 108u8, + 101u8, 18u8, 24u8, 10u8, 7u8, 109u8, 101u8, 115u8, 115u8, 97u8, 103u8, 101u8, 24u8, + 2u8, 32u8, 1u8, 40u8, 9u8, 82u8, 7u8, 109u8, 101u8, 115u8, 115u8, 97u8, 103u8, 101u8, + 66u8, 108u8, 10u8, 14u8, 99u8, 111u8, 109u8, 46u8, 103u8, 111u8, 111u8, 103u8, 108u8, + 101u8, 46u8, 114u8, 112u8, 99u8, 66u8, 17u8, 69u8, 114u8, 114u8, 111u8, 114u8, 68u8, + 101u8, 116u8, 97u8, 105u8, 108u8, 115u8, 80u8, 114u8, 111u8, 116u8, 111u8, 80u8, 1u8, + 90u8, 63u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, 46u8, 103u8, 111u8, 108u8, + 97u8, 110u8, 103u8, 46u8, 111u8, 114u8, 103u8, 47u8, 103u8, 101u8, 110u8, 112u8, + 114u8, 111u8, 116u8, 111u8, 47u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, 97u8, + 112u8, 105u8, 115u8, 47u8, 114u8, 112u8, 99u8, 47u8, 101u8, 114u8, 114u8, 100u8, + 101u8, 116u8, 97u8, 105u8, 108u8, 115u8, 59u8, 101u8, 114u8, 114u8, 100u8, 101u8, + 116u8, 97u8, 105u8, 108u8, 115u8, 162u8, 2u8, 3u8, 82u8, 80u8, 67u8, 98u8, 6u8, + 112u8, 114u8, 111u8, 116u8, 111u8, 51u8, ]; From b77e0eb398abe90db14308e7987cf4ead7939005 Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 24 Mar 2025 22:29:10 +0900 Subject: [PATCH 14/61] chore: Update cargo-deny config (#2210) * chore: Add rustix and linux-raw-sys crate to cargo-deny skip config * chore: Ignore RUSTSEC-2024-0436 --- deny.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deny.toml b/deny.toml index 8fc479b93..5dda4ae3e 100644 --- a/deny.toml +++ b/deny.toml @@ -2,6 +2,11 @@ all-features = true exclude = ["examples"] +[advisories] +ignore = [ + { id = "RUSTSEC-2024-0436", reason = "paste crate is unmaintained. aws-lc-rs, aws-lc-sys and compression test depend on it." }, +] + [bans] multiple-versions = "deny" deny = [ @@ -23,6 +28,8 @@ skip = [ { crate = "wasi@0.11.0+wasi-snapshot-preview1", reason = "quickcheck depends on rand which depends on it" }, { crate = "itertools@0.12.1", reason = "aws-lc-sys depends on bindgen which depends on it" }, { crate = "unicode-width@0.1.14", reason = "protox depends on miette wich depends on it" }, + { crate = "rustix@0.38.44", reason = "aws-lc-sys depends on bindgen which depends on it" }, + { crate = "linux-raw-sys@0.4.15", reason = "rustix 0.38.44 depends on it" }, ] skip-tree = [ { crate = "windows-sys" }, From e1fe87cabbf2ca0adfe4bc7e63296d3b9bfb3ad3 Mon Sep 17 00:00:00 2001 From: "DAKAI, TZOU" Date: Mon, 24 Mar 2025 21:42:43 +0800 Subject: [PATCH 15/61] Remove unnecessary mut (#2219) * remove unnecessary mut * remove unnecessary mut for health_reporter --------- Co-authored-by: tottoto --- examples/src/health/server.rs | 4 ++-- tonic-health/src/server.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/src/health/server.rs b/examples/src/health/server.rs index 7b12e8668..4ae198d51 100644 --- a/examples/src/health/server.rs +++ b/examples/src/health/server.rs @@ -29,7 +29,7 @@ impl Greeter for MyGreeter { /// This function (somewhat improbably) flips the status of a service every second, in order /// that the effect of `tonic_health::HealthReporter::watch` can be easily observed. -async fn twiddle_service_status(mut reporter: HealthReporter) { +async fn twiddle_service_status(reporter: HealthReporter) { let mut iter = 0u64; loop { iter += 1; @@ -45,7 +45,7 @@ async fn twiddle_service_status(mut reporter: HealthReporter) { #[tokio::main] async fn main() -> Result<(), Box> { - let (mut health_reporter, health_service) = tonic_health::server::health_reporter(); + let (health_reporter, health_service) = tonic_health::server::health_reporter(); health_reporter .set_serving::>() .await; diff --git a/tonic-health/src/server.rs b/tonic-health/src/server.rs index 7cae885ff..a512b60fd 100644 --- a/tonic-health/src/server.rs +++ b/tonic-health/src/server.rs @@ -48,7 +48,7 @@ impl HealthReporter { /// Sets the status of the service implemented by `S` to `Serving`. This notifies any watchers /// if there is a change in status. - pub async fn set_serving(&mut self) + pub async fn set_serving(&self) where S: NamedService, { @@ -59,7 +59,7 @@ impl HealthReporter { /// Sets the status of the service implemented by `S` to `NotServing`. This notifies any watchers /// if there is a change in status. - pub async fn set_not_serving(&mut self) + pub async fn set_not_serving(&self) where S: NamedService, { @@ -70,7 +70,7 @@ impl HealthReporter { /// Sets the status of the service with `service_name` to `status`. This notifies any watchers /// if there is a change in status. - pub async fn set_service_status(&mut self, service_name: S, status: ServingStatus) + pub async fn set_service_status(&self, service_name: S, status: ServingStatus) where S: AsRef, { @@ -220,7 +220,7 @@ mod tests { #[tokio::test] async fn test_service_check() { - let (mut reporter, service) = make_test_service().await; + let (reporter, service) = make_test_service().await; // Overall server health let resp = service From 9e9ad8a12c112444b08137b412164bf9daeed22f Mon Sep 17 00:00:00 2001 From: jimmycathy Date: Mon, 24 Mar 2025 21:54:34 +0800 Subject: [PATCH 16/61] chore: fix some comments (#2224) Signed-off-by: jimmycathy Co-authored-by: tottoto --- tonic-types/README.md | 2 +- tonic-types/src/lib.rs | 2 +- tonic/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tonic-types/README.md b/tonic-types/README.md index f1e0ca9bd..1f5763463 100644 --- a/tonic-types/README.md +++ b/tonic-types/README.md @@ -19,7 +19,7 @@ and handle them with ease. ## Examples -The examples bellow cover a basic use case of the [gRPC Richer Error Model]. +The examples below cover a basic use case of the [gRPC Richer Error Model]. More complete server and client implementations are provided in the **Richer Error example**, located in the main repo [examples] directory. diff --git a/tonic-types/src/lib.rs b/tonic-types/src/lib.rs index c70079b9a..e9916326e 100644 --- a/tonic-types/src/lib.rs +++ b/tonic-types/src/lib.rs @@ -25,7 +25,7 @@ //! //! # Examples //! -//! The examples bellow cover a basic use case of the [gRPC Richer Error Model]. +//! The examples below cover a basic use case of the [gRPC Richer Error Model]. //! More complete server and client implementations are provided in the //! **Richer Error example**, located in the main repo [examples] directory. //! diff --git a/tonic/src/lib.rs b/tonic/src/lib.rs index 4bcb80d00..88ac07a86 100644 --- a/tonic/src/lib.rs +++ b/tonic/src/lib.rs @@ -25,7 +25,7 @@ //! - `codegen`: Enables all the required exports and optional dependencies required //! for [`tonic-build`]. Enabled by default. //! - `tls-ring`: Enables the [`rustls`] based TLS options for the `transport` feature using -//! the [`ring`]` libcrypto provider. Not enabled by default. +//! the [`ring`] libcrypto provider. Not enabled by default. //! - `tls-aws-lc`: Enables the [`rustls`] based TLS options for the `transport` feature using //! the [`aws-lc-rs`] libcrypto provider. Not enabled by default. //! - `tls-native-roots`: Adds system trust roots to [`rustls`]-based gRPC clients using the From 15e715c449a1fbf73bbcf687bb7380cdab9d054f Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 24 Mar 2025 22:56:26 +0900 Subject: [PATCH 17/61] feat: Allow convert i32 to Code in const context (#2195) --- tonic/src/status.rs | 46 ++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tonic/src/status.rs b/tonic/src/status.rs index 6c3e9b0bf..fbf696ffd 100644 --- a/tonic/src/status.rs +++ b/tonic/src/status.rs @@ -779,8 +779,28 @@ impl Code { /// Get the `Code` that represents the integer, if known. /// /// If not known, returns `Code::Unknown` (surprise!). - pub fn from_i32(i: i32) -> Code { - Code::from(i) + pub const fn from_i32(i: i32) -> Code { + match i { + 0 => Code::Ok, + 1 => Code::Cancelled, + 2 => Code::Unknown, + 3 => Code::InvalidArgument, + 4 => Code::DeadlineExceeded, + 5 => Code::NotFound, + 6 => Code::AlreadyExists, + 7 => Code::PermissionDenied, + 8 => Code::ResourceExhausted, + 9 => Code::FailedPrecondition, + 10 => Code::Aborted, + 11 => Code::OutOfRange, + 12 => Code::Unimplemented, + 13 => Code::Internal, + 14 => Code::Unavailable, + 15 => Code::DataLoss, + 16 => Code::Unauthenticated, + + _ => Code::Unknown, + } } /// Convert the string representation of a `Code` (as stored, for example, in the `grpc-status` @@ -845,27 +865,7 @@ impl Code { impl From for Code { fn from(i: i32) -> Self { - match i { - 0 => Code::Ok, - 1 => Code::Cancelled, - 2 => Code::Unknown, - 3 => Code::InvalidArgument, - 4 => Code::DeadlineExceeded, - 5 => Code::NotFound, - 6 => Code::AlreadyExists, - 7 => Code::PermissionDenied, - 8 => Code::ResourceExhausted, - 9 => Code::FailedPrecondition, - 10 => Code::Aborted, - 11 => Code::OutOfRange, - 12 => Code::Unimplemented, - 13 => Code::Internal, - 14 => Code::Unavailable, - 15 => Code::DataLoss, - 16 => Code::Unauthenticated, - - _ => Code::Unknown, - } + Code::from_i32(i) } } From 881dc8776e3d6b5cb08f0a8b98a0cd22c1737e13 Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 24 Mar 2025 22:56:36 +0900 Subject: [PATCH 18/61] chore: Disable unused tower feature (#2196) --- tonic/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tonic/Cargo.toml b/tonic/Cargo.toml index eee2c3f73..76b28ad0c 100644 --- a/tonic/Cargo.toml +++ b/tonic/Cargo.toml @@ -105,7 +105,7 @@ quickcheck_macros = "1.0" rand = "0.8" static_assertions = "1.0" tokio = {version = "1.0", features = ["rt", "macros"]} -tower = {version = "0.5", features = ["full"]} +tower = {version = "0.5", features = ["load-shed", "timeout"]} [lints] workspace = true From 8a658cf95eb39641b065a8d0029a696071d47ff8 Mon Sep 17 00:00:00 2001 From: tottoto Date: Tue, 25 Mar 2025 23:38:20 +0900 Subject: [PATCH 19/61] chore(router): Remove unnecessary body type converting (#2214) --- tonic/src/service/router.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tonic/src/service/router.rs b/tonic/src/service/router.rs index 474099239..0ff830419 100644 --- a/tonic/src/service/router.rs +++ b/tonic/src/service/router.rs @@ -155,7 +155,7 @@ where } fn call(&mut self, req: Request) -> Self::Future { - RoutesFuture(self.router.call(req.map(axum::body::Body::new))) + RoutesFuture(self.router.call(req)) } } From 5cf8562aae01663d2d3fefe53463809dc8a8a321 Mon Sep 17 00:00:00 2001 From: tottoto Date: Tue, 25 Mar 2025 23:39:26 +0900 Subject: [PATCH 20/61] chore(server): Use standard library pin macro (#2212) --- tonic/src/transport/server/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tonic/src/transport/server/mod.rs b/tonic/src/transport/server/mod.rs index 2427065d6..0be031d95 100644 --- a/tonic/src/transport/server/mod.rs +++ b/tonic/src/transport/server/mod.rs @@ -788,8 +788,7 @@ fn serve_connection( let mut conn = pin!(builder.serve_connection(hyper_io, hyper_svc)); - let sleep = sleep_or_pending(max_connection_age); - tokio::pin!(sleep); + let mut sleep = pin!(sleep_or_pending(max_connection_age)); loop { tokio::select! { From e0bc02991080a332746ea2de1244dbc911194b28 Mon Sep 17 00:00:00 2001 From: tottoto Date: Tue, 25 Mar 2025 23:39:39 +0900 Subject: [PATCH 21/61] chore(build): Use idiomatic api (#2211) --- tonic-build/src/prost.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tonic-build/src/prost.rs b/tonic-build/src/prost.rs index 7cfb6ad08..6bf3847b2 100644 --- a/tonic-build/src/prost.rs +++ b/tonic-build/src/prost.rs @@ -172,7 +172,7 @@ impl crate::Method for TonicBuildMethod { let convert_type = |proto_type: &str, rust_type: &str| -> TokenStream { if (is_google_type(proto_type) && !compile_well_known_types) || rust_type.starts_with("::") - || NON_PATH_TYPE_ALLOWLIST.iter().any(|ty| *ty == rust_type) + || NON_PATH_TYPE_ALLOWLIST.contains(&rust_type) { rust_type.parse::().unwrap() } else if rust_type.starts_with("crate::") { From 7da12d4a5029d7b8574c0c9541fa10428ab89bcd Mon Sep 17 00:00:00 2001 From: tottoto Date: Tue, 25 Mar 2025 23:39:59 +0900 Subject: [PATCH 22/61] feat(tonic): Exclude benches-disabled to remove Apache-2.0 resource (#2204) --- tonic/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/tonic/Cargo.toml b/tonic/Cargo.toml index 76b28ad0c..a43e6c118 100644 --- a/tonic/Cargo.toml +++ b/tonic/Cargo.toml @@ -21,6 +21,7 @@ readme = "../README.md" repository = "https://github.com/hyperium/tonic" version = "0.13.0" rust-version = {workspace = true} +exclude = ["benches-disabled"] [features] codegen = ["dep:async-trait"] From 04563104362f27e26c6bda7babb0a438cb39a44c Mon Sep 17 00:00:00 2001 From: tottoto Date: Tue, 25 Mar 2025 23:40:28 +0900 Subject: [PATCH 23/61] chore(ci): Add concurrency group to cancel old ci (#2202) --- .github/workflows/CI.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index eda0c9c48..ee111e182 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -7,6 +7,10 @@ on: merge_group: branches: [ "master" ] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: RUSTFLAGS: "-D warnings" From b7bc599981becc0e8d395a17c8d72c86625ab849 Mon Sep 17 00:00:00 2001 From: tottoto Date: Tue, 25 Mar 2025 23:40:44 +0900 Subject: [PATCH 24/61] chore(test): Use library crate in test (#2201) --- tests/ambiguous_methods/src/{main.rs => lib.rs} | 4 ---- tests/root-crate-path/src/{main.rs => lib.rs} | 4 ---- tests/stream_conflict/src/{main.rs => lib.rs} | 4 ---- 3 files changed, 12 deletions(-) rename tests/ambiguous_methods/src/{main.rs => lib.rs} (62%) rename tests/root-crate-path/src/{main.rs => lib.rs} (87%) rename tests/stream_conflict/src/{main.rs => lib.rs} (60%) diff --git a/tests/ambiguous_methods/src/main.rs b/tests/ambiguous_methods/src/lib.rs similarity index 62% rename from tests/ambiguous_methods/src/main.rs rename to tests/ambiguous_methods/src/lib.rs index b8673be27..195899a49 100644 --- a/tests/ambiguous_methods/src/main.rs +++ b/tests/ambiguous_methods/src/lib.rs @@ -2,7 +2,3 @@ extern crate tonic; tonic::include_proto!("ambiguous_methods"); - -fn main() { - println!("Hello, world!"); -} diff --git a/tests/root-crate-path/src/main.rs b/tests/root-crate-path/src/lib.rs similarity index 87% rename from tests/root-crate-path/src/main.rs rename to tests/root-crate-path/src/lib.rs index bf879bc70..0551cdfd8 100644 --- a/tests/root-crate-path/src/main.rs +++ b/tests/root-crate-path/src/lib.rs @@ -13,7 +13,3 @@ pub mod foo { } } } - -fn main() { - println!("Hello, world!"); -} diff --git a/tests/stream_conflict/src/main.rs b/tests/stream_conflict/src/lib.rs similarity index 60% rename from tests/stream_conflict/src/main.rs rename to tests/stream_conflict/src/lib.rs index ab96cfdee..a1b602d10 100644 --- a/tests/stream_conflict/src/main.rs +++ b/tests/stream_conflict/src/lib.rs @@ -1,7 +1,3 @@ mod stream_conflict { tonic::include_proto!("stream_conflict"); } - -fn main() { - println!("Hello, world!"); -} From 9910bfa09e0b03326a5122ef4ec41dce8114f6a2 Mon Sep 17 00:00:00 2001 From: tottoto Date: Tue, 25 Mar 2025 23:41:32 +0900 Subject: [PATCH 25/61] chore: Remove unused rand crate from dev-dependencies (#2198) --- tonic/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/tonic/Cargo.toml b/tonic/Cargo.toml index a43e6c118..e06996c94 100644 --- a/tonic/Cargo.toml +++ b/tonic/Cargo.toml @@ -103,7 +103,6 @@ hyper-timeout = {version = "0.5", optional = true} bencher = "0.1.5" quickcheck = "1.0" quickcheck_macros = "1.0" -rand = "0.8" static_assertions = "1.0" tokio = {version = "1.0", features = ["rt", "macros"]} tower = {version = "0.5", features = ["load-shed", "timeout"]} From 082da3f4f3fd6f2b0490407ab92e1601dbf7f0ea Mon Sep 17 00:00:00 2001 From: tottoto Date: Tue, 25 Mar 2025 23:42:26 +0900 Subject: [PATCH 26/61] chore: Remove documentation config in manifest (#2193) --- prepare-release.sh | 4 ---- tonic-build/Cargo.toml | 1 - tonic-health/Cargo.toml | 1 - tonic-reflection/Cargo.toml | 1 - tonic-types/Cargo.toml | 1 - tonic-web/Cargo.toml | 1 - tonic/Cargo.toml | 4 ---- 7 files changed, 13 deletions(-) diff --git a/prepare-release.sh b/prepare-release.sh index 3e6caa34b..1c5254bd4 100755 --- a/prepare-release.sh +++ b/prepare-release.sh @@ -33,10 +33,6 @@ CRATES=( \ ) for CRATE in "${CRATES[@]}"; do - # Update documentation url in Cargo.toml - sed -i -E "s~documentation = \"https://docs\.rs/$CRATE/$VERSION_MATCHER\"~documentation = \"https://docs.rs/${CRATE}/${VERSION}\"~" \ - "$DIR/$CRATE/Cargo.toml" - # Update Cargo.toml version fields. sed -i -E "s/^version = \"${VERSION_MATCHER}\"$/version = \"${VERSION}\"/" \ "$DIR/$CRATE/Cargo.toml" diff --git a/tonic-build/Cargo.toml b/tonic-build/Cargo.toml index 456eda887..e47b3307e 100644 --- a/tonic-build/Cargo.toml +++ b/tonic-build/Cargo.toml @@ -4,7 +4,6 @@ categories = ["network-programming", "asynchronous"] description = """ Codegen module of `tonic` gRPC implementation. """ -documentation = "https://docs.rs/tonic-build/0.13.0" edition = "2021" homepage = "https://github.com/hyperium/tonic" keywords = ["rpc", "grpc", "async", "codegen", "protobuf"] diff --git a/tonic-health/Cargo.toml b/tonic-health/Cargo.toml index 95a6ad147..fe6fd2a52 100644 --- a/tonic-health/Cargo.toml +++ b/tonic-health/Cargo.toml @@ -4,7 +4,6 @@ categories = ["network-programming", "asynchronous"] description = """ Health Checking module of `tonic` gRPC implementation. """ -documentation = "https://docs.rs/tonic-health/0.13.0" edition = "2021" homepage = "https://github.com/hyperium/tonic" keywords = ["rpc", "grpc", "async", "healthcheck"] diff --git a/tonic-reflection/Cargo.toml b/tonic-reflection/Cargo.toml index 09a30ea80..85b498276 100644 --- a/tonic-reflection/Cargo.toml +++ b/tonic-reflection/Cargo.toml @@ -9,7 +9,6 @@ Server Reflection module of `tonic` gRPC implementation. """ edition = "2021" homepage = "https://github.com/hyperium/tonic" -documentation = "https://docs.rs/tonic-reflection/0.13.0" keywords = ["rpc", "grpc", "async", "reflection"] license = "MIT" name = "tonic-reflection" diff --git a/tonic-types/Cargo.toml b/tonic-types/Cargo.toml index 2ee953238..6ea75da69 100644 --- a/tonic-types/Cargo.toml +++ b/tonic-types/Cargo.toml @@ -7,7 +7,6 @@ categories = ["web-programming", "network-programming", "asynchronous"] description = """ A collection of useful protobuf types that can be used with `tonic`. """ -documentation = "https://docs.rs/tonic-types/0.13.0" edition = "2021" homepage = "https://github.com/hyperium/tonic" keywords = ["rpc", "grpc", "protobuf"] diff --git a/tonic-web/Cargo.toml b/tonic-web/Cargo.toml index e6ca057f8..b3301aaa4 100644 --- a/tonic-web/Cargo.toml +++ b/tonic-web/Cargo.toml @@ -4,7 +4,6 @@ categories = ["network-programming", "asynchronous"] description = """ grpc-web protocol translation for tonic services. """ -documentation = "https://docs.rs/tonic-web/0.13.0" edition = "2021" homepage = "https://github.com/hyperium/tonic" keywords = ["rpc", "grpc", "grpc-web"] diff --git a/tonic/Cargo.toml b/tonic/Cargo.toml index e06996c94..a5ac98bd5 100644 --- a/tonic/Cargo.toml +++ b/tonic/Cargo.toml @@ -2,9 +2,6 @@ name = "tonic" # When releasing to crates.io: # - Remove path dependencies -# - Update doc url -# - Cargo.toml -# - README.md # - Update CHANGELOG.md. # - Create "v0.11.x" git tag. authors = ["Lucio Franco "] @@ -12,7 +9,6 @@ categories = ["web-programming", "network-programming", "asynchronous"] description = """ A gRPC over HTTP/2 implementation focused on high performance, interoperability, and flexibility. """ -documentation = "https://docs.rs/tonic/0.13.0" edition = "2021" homepage = "https://github.com/hyperium/tonic" keywords = ["rpc", "grpc", "async", "futures", "protobuf"] From 7274ce2c2cd014c86a1d37ff59fa3f3bfd8bce20 Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 26 Mar 2025 00:24:34 +0900 Subject: [PATCH 27/61] chore(test): Remove unnecessary macro_use (#2200) --- tests/ambiguous_methods/src/lib.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/ambiguous_methods/src/lib.rs b/tests/ambiguous_methods/src/lib.rs index 195899a49..cefae90c7 100644 --- a/tests/ambiguous_methods/src/lib.rs +++ b/tests/ambiguous_methods/src/lib.rs @@ -1,4 +1 @@ -#[macro_use] -extern crate tonic; - tonic::include_proto!("ambiguous_methods"); From 45a0cfef3160705c33260e01f179cf9601c796e7 Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 26 Mar 2025 00:56:57 +0900 Subject: [PATCH 28/61] feat: Add proto header to generated code (#2205) --- codegen/src/main.rs | 36 +++++++- .../src/generated/grpc_health_v1_fds.rs | 16 ++++ .../src/generated/reflection_v1_fds.rs | 20 +++++ .../src/generated/reflection_v1alpha1_fds.rs | 15 ++++ tonic-types/src/generated/types_fds.rs | 85 +++++++++++++++++++ 5 files changed, 169 insertions(+), 3 deletions(-) diff --git a/codegen/src/main.rs b/codegen/src/main.rs index 4285ce983..9dd7f322a 100644 --- a/codegen/src/main.rs +++ b/codegen/src/main.rs @@ -113,7 +113,22 @@ fn codegen( fn write_fds(fds: &FileDescriptorSet, path: &Path) { const GENERATED_COMMENT: &str = "// This file is @generated by codegen."; + let mut file_header = String::new(); + let mut fds = fds.clone(); + + for fd in fds.file.iter() { + let Some(source_code_info) = &fd.source_code_info else { + continue; + }; + + for location in &source_code_info.location { + for comment in &location.leading_detached_comments { + file_header += comment; + } + } + } + for fd in fds.file.iter_mut() { fd.source_code_info = None; } @@ -126,8 +141,23 @@ fn write_fds(fds: &FileDescriptorSet, path: &Path) { let ast = syn::parse2(tokens).unwrap(); let formatted = prettyplease::unparse(&ast); - let content = format!("{GENERATED_COMMENT}\n{formatted}"); - let mut writer = BufWriter::new(File::create(path).unwrap()); - writer.write_all(content.as_bytes()).unwrap(); + + writer.write_all(GENERATED_COMMENT.as_bytes()).unwrap(); + writer.write_all(b"\n").unwrap(); + + if !file_header.is_empty() { + let file_header = comment_out(&file_header); + writer.write_all(file_header.as_bytes()).unwrap(); + writer.write_all(b"\n").unwrap(); + } + + writer.write_all(formatted.as_bytes()).unwrap() +} + +fn comment_out(s: &str) -> String { + s.split('\n') + .map(|line| format!("// {line}")) + .collect::>() + .join("\n") } diff --git a/tonic-health/src/generated/grpc_health_v1_fds.rs b/tonic-health/src/generated/grpc_health_v1_fds.rs index 38df98031..45cc00bf5 100644 --- a/tonic-health/src/generated/grpc_health_v1_fds.rs +++ b/tonic-health/src/generated/grpc_health_v1_fds.rs @@ -1,4 +1,20 @@ // This file is @generated by codegen. +// Copyright 2015 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// The canonical version of this proto can be found at +// https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto +// /// Byte encoded FILE_DESCRIPTOR_SET. pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 10u8, 158u8, 4u8, 10u8, 12u8, 104u8, 101u8, 97u8, 108u8, 116u8, 104u8, 46u8, 112u8, diff --git a/tonic-reflection/src/generated/reflection_v1_fds.rs b/tonic-reflection/src/generated/reflection_v1_fds.rs index 894146337..4edd5c20d 100644 --- a/tonic-reflection/src/generated/reflection_v1_fds.rs +++ b/tonic-reflection/src/generated/reflection_v1_fds.rs @@ -1,4 +1,24 @@ // This file is @generated by codegen. +// Copyright 2016 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// Service exported by server reflection. A more complete description of how +// server reflection works can be found at +// https://github.com/grpc/grpc/blob/master/doc/server-reflection.md +// +// The canonical version of this proto can be found at +// https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto +// /// Byte encoded FILE_DESCRIPTOR_SET. pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 10u8, 192u8, 13u8, 10u8, 19u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, diff --git a/tonic-reflection/src/generated/reflection_v1alpha1_fds.rs b/tonic-reflection/src/generated/reflection_v1alpha1_fds.rs index 699e4268c..240b4cb0b 100644 --- a/tonic-reflection/src/generated/reflection_v1alpha1_fds.rs +++ b/tonic-reflection/src/generated/reflection_v1alpha1_fds.rs @@ -1,4 +1,19 @@ // This file is @generated by codegen. +// Copyright 2016 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// Service exported by server reflection +// /// Byte encoded FILE_DESCRIPTOR_SET. pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 10u8, 143u8, 13u8, 10u8, 24u8, 114u8, 101u8, 102u8, 108u8, 101u8, 99u8, 116u8, 105u8, diff --git a/tonic-types/src/generated/types_fds.rs b/tonic-types/src/generated/types_fds.rs index 865b7fcd8..b16fdcd09 100644 --- a/tonic-types/src/generated/types_fds.rs +++ b/tonic-types/src/generated/types_fds.rs @@ -1,4 +1,89 @@ // This file is @generated by codegen. +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// /// Byte encoded FILE_DESCRIPTOR_SET. pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 10u8, 228u8, 1u8, 10u8, 25u8, 103u8, 111u8, 111u8, 103u8, 108u8, 101u8, 47u8, 112u8, From 7b4803b9722b3a7e2f327208b20172bcdd818569 Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 26 Mar 2025 00:57:14 +0900 Subject: [PATCH 29/61] chore(router): Use upstream poll_ready to implement service (#2215) --- tonic/src/service/router.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tonic/src/service/router.rs b/tonic/src/service/router.rs index 0ff830419..61d2a860a 100644 --- a/tonic/src/service/router.rs +++ b/tonic/src/service/router.rs @@ -150,8 +150,8 @@ where type Future = RoutesFuture; #[inline] - fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll> { - Poll::Ready(Ok(())) + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { + Service::>::poll_ready(&mut self.router, cx).map_err(|e| match e {}) } fn call(&mut self, req: Request) -> Self::Future { From 6a34e2626ece4c535203164cd2e932dfe0e5fd7a Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 26 Mar 2025 01:08:35 +0900 Subject: [PATCH 30/61] feat(router): Use infallible as error type (#2232) --- tonic/src/service/router.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tonic/src/service/router.rs b/tonic/src/service/router.rs index 61d2a860a..1a8ae366c 100644 --- a/tonic/src/service/router.rs +++ b/tonic/src/service/router.rs @@ -5,7 +5,7 @@ use std::{ fmt, future::Future, pin::Pin, - task::{ready, Context, Poll}, + task::{Context, Poll}, }; use tower::{Service, ServiceExt}; @@ -146,7 +146,7 @@ where B::Error: Into, { type Response = Response; - type Error = crate::BoxError; + type Error = Infallible; type Future = RoutesFuture; #[inline] @@ -168,15 +168,11 @@ impl fmt::Debug for RoutesFuture { } impl Future for RoutesFuture { - type Output = Result, crate::BoxError>; + type Output = Result, Infallible>; fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - match ready!(Pin::new(&mut self.as_mut().0).poll(cx)) { - Ok(res) => Ok(res.map(Body::new)).into(), - // NOTE: This pattern is not needed from Rust 1.82. - // See https://github.com/rust-lang/rust/pull/122792. - #[allow(unreachable_patterns)] - Err(err) => match err {}, - } + Pin::new(&mut self.as_mut().0) + .poll(cx) + .map_ok(|res| res.map(Body::new)) } } From 99476a43c133b9dda7f751c707fe30059b0584e0 Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 26 Mar 2025 01:10:06 +0900 Subject: [PATCH 31/61] chore: Remove unnecessary license file from private crate (#2203) --- examples/LICENSE | 19 ------------------- interop/LICENSE | 19 ------------------- tests/ambiguous_methods/LICENSE | 19 ------------------- tests/compression/LICENSE | 19 ------------------- tests/extern_path/my_application/LICENSE | 19 ------------------- tests/extern_path/uuid/LICENSE | 19 ------------------- tests/included_service/LICENSE | 19 ------------------- tests/integration_tests/LICENSE | 19 ------------------- tests/root-crate-path/LICENSE | 19 ------------------- tests/same_name/LICENSE | 19 ------------------- tests/service_named_result/Cargo.toml | 1 + tests/service_named_result/LICENSE | 19 ------------------- tests/service_named_service/LICENSE | 19 ------------------- tests/stream_conflict/LICENSE | 19 ------------------- tests/use_arc_self/LICENSE | 19 ------------------- tests/web/LICENSE | 19 ------------------- tests/wellknown-compiled/LICENSE | 19 ------------------- tests/wellknown/LICENSE | 19 ------------------- 18 files changed, 1 insertion(+), 323 deletions(-) delete mode 100644 examples/LICENSE delete mode 100644 interop/LICENSE delete mode 100644 tests/ambiguous_methods/LICENSE delete mode 100644 tests/compression/LICENSE delete mode 100644 tests/extern_path/my_application/LICENSE delete mode 100644 tests/extern_path/uuid/LICENSE delete mode 100644 tests/included_service/LICENSE delete mode 100644 tests/integration_tests/LICENSE delete mode 100644 tests/root-crate-path/LICENSE delete mode 100644 tests/same_name/LICENSE delete mode 100644 tests/service_named_result/LICENSE delete mode 100644 tests/service_named_service/LICENSE delete mode 100644 tests/stream_conflict/LICENSE delete mode 100644 tests/use_arc_self/LICENSE delete mode 100644 tests/web/LICENSE delete mode 100644 tests/wellknown-compiled/LICENSE delete mode 100644 tests/wellknown/LICENSE diff --git a/examples/LICENSE b/examples/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/examples/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/interop/LICENSE b/interop/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/interop/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/ambiguous_methods/LICENSE b/tests/ambiguous_methods/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/ambiguous_methods/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/compression/LICENSE b/tests/compression/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/compression/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/extern_path/my_application/LICENSE b/tests/extern_path/my_application/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/extern_path/my_application/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/extern_path/uuid/LICENSE b/tests/extern_path/uuid/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/extern_path/uuid/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/included_service/LICENSE b/tests/included_service/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/included_service/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/integration_tests/LICENSE b/tests/integration_tests/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/integration_tests/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/root-crate-path/LICENSE b/tests/root-crate-path/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/root-crate-path/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/same_name/LICENSE b/tests/same_name/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/same_name/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/service_named_result/Cargo.toml b/tests/service_named_result/Cargo.toml index 593f116d4..73bb95ce8 100644 --- a/tests/service_named_result/Cargo.toml +++ b/tests/service_named_result/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "service_named_result" edition = "2021" +license = "MIT" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/tests/service_named_result/LICENSE b/tests/service_named_result/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/service_named_result/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/service_named_service/LICENSE b/tests/service_named_service/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/service_named_service/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/stream_conflict/LICENSE b/tests/stream_conflict/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/stream_conflict/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/use_arc_self/LICENSE b/tests/use_arc_self/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/use_arc_self/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/web/LICENSE b/tests/web/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/web/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/wellknown-compiled/LICENSE b/tests/wellknown-compiled/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/wellknown-compiled/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/wellknown/LICENSE b/tests/wellknown/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tests/wellknown/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. From 2f763643a5e9fa9d4c8cfcac3e2d4a77c62d1b8f Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Tue, 25 Mar 2025 12:26:38 -0400 Subject: [PATCH 32/61] chore: update changelog to point to releases (#2235) --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30140044e..20fcca43d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# NOTE: ths changelog is no longer used and from version `v0.13.0` onward we +will be using github releases and the changes can be found +[here](https://github.com/hyperium/tonic/releases). + # [0.12.3](https://github.com/hyperium/tonic/compare/v0.12.2...v0.12.3) (2024-08-29) ### Features From 0e6c9cb7de4262333c66ad311a1bc8f0d4f3268c Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Tue, 25 Mar 2025 12:27:22 -0400 Subject: [PATCH 33/61] chore: fix changelog header --- CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20fcca43d..4e76f675c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,4 @@ -# NOTE: ths changelog is no longer used and from version `v0.13.0` onward we -will be using github releases and the changes can be found -[here](https://github.com/hyperium/tonic/releases). +# NOTE: ths changelog is no longer used and from version `v0.13.0` onward we will be using github releases and the changes can be found [here](https://github.com/hyperium/tonic/releases). # [0.12.3](https://github.com/hyperium/tonic/compare/v0.12.2...v0.12.3) (2024-08-29) From 29fcc7fed90d6fbb6697665316cf6054067e8ccb Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 26 Mar 2025 01:49:09 +0900 Subject: [PATCH 34/61] chore(server): Remove import sleep and pending function (#2234) --- tonic/src/transport/server/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tonic/src/transport/server/mod.rs b/tonic/src/transport/server/mod.rs index 0be031d95..7a62ba939 100644 --- a/tonic/src/transport/server/mod.rs +++ b/tonic/src/transport/server/mod.rs @@ -50,7 +50,6 @@ use http::{Request, Response}; use http_body_util::BodyExt; use hyper::{body::Incoming, service::Service as HyperService}; use pin_project::pin_project; -use std::future::pending; use std::{ fmt, future::{self, poll_fn, Future}, @@ -62,7 +61,6 @@ use std::{ time::Duration, }; use tokio::io::{AsyncRead, AsyncWrite}; -use tokio::time::sleep; use tokio_stream::Stream; use tower::{ layer::util::{Identity, Stack}, @@ -816,8 +814,8 @@ fn serve_connection( async fn sleep_or_pending(wait_for: Option) { match wait_for { - Some(wait) => sleep(wait).await, - None => pending().await, + Some(wait) => tokio::time::sleep(wait).await, + None => future::pending().await, }; } From e36a1684720f2a1dffae3ec8cee3ad096dcbeb02 Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 26 Mar 2025 01:49:52 +0900 Subject: [PATCH 35/61] chore(server): Refactor default http2 keepalive timeout config (#2213) --- tonic/src/transport/server/mod.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tonic/src/transport/server/mod.rs b/tonic/src/transport/server/mod.rs index 7a62ba939..fc5c04b7a 100644 --- a/tonic/src/transport/server/mod.rs +++ b/tonic/src/transport/server/mod.rs @@ -73,7 +73,7 @@ use tower::{ type BoxService = tower::util::BoxCloneService, Response, crate::BoxError>; type TraceInterceptor = Arc) -> tracing::Span + Send + Sync + 'static>; -const DEFAULT_HTTP2_KEEPALIVE_TIMEOUT_SECS: u64 = 20; +const DEFAULT_HTTP2_KEEPALIVE_TIMEOUT: Duration = Duration::from_secs(20); /// A default batteries included `transport` server. /// @@ -96,7 +96,7 @@ pub struct Server { tcp_keepalive: Option, tcp_nodelay: bool, http2_keepalive_interval: Option, - http2_keepalive_timeout: Option, + http2_keepalive_timeout: Duration, http2_adaptive_window: Option, http2_max_pending_accept_reset_streams: Option, http2_max_header_list_size: Option, @@ -120,7 +120,7 @@ impl Default for Server { tcp_keepalive: None, tcp_nodelay: false, http2_keepalive_interval: None, - http2_keepalive_timeout: None, + http2_keepalive_timeout: DEFAULT_HTTP2_KEEPALIVE_TIMEOUT, http2_adaptive_window: None, http2_max_pending_accept_reset_streams: None, http2_max_header_list_size: None, @@ -283,11 +283,11 @@ impl Server { /// Default is 20 seconds. /// #[must_use] - pub fn http2_keepalive_timeout(self, http2_keepalive_timeout: Option) -> Self { - Server { - http2_keepalive_timeout, - ..self + pub fn http2_keepalive_timeout(mut self, http2_keepalive_timeout: Option) -> Self { + if let Some(timeout) = http2_keepalive_timeout { + self.http2_keepalive_timeout = timeout; } + self } /// Sets whether to use an adaptive flow control. Defaults to false. @@ -652,9 +652,7 @@ impl Server { let http2_only = !self.accept_http1; let http2_keepalive_interval = self.http2_keepalive_interval; - let http2_keepalive_timeout = self - .http2_keepalive_timeout - .unwrap_or_else(|| Duration::new(DEFAULT_HTTP2_KEEPALIVE_TIMEOUT_SECS, 0)); + let http2_keepalive_timeout = self.http2_keepalive_timeout; let http2_adaptive_window = self.http2_adaptive_window; let http2_max_pending_accept_reset_streams = self.http2_max_pending_accept_reset_streams; let max_connection_age = self.max_connection_age; From 885b38e674864cd819a8bf42d14c8400f8c4657a Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 26 Mar 2025 03:22:47 +0900 Subject: [PATCH 36/61] chore: Remove unnecessary docs.rs config (#2223) --- tonic-reflection/Cargo.toml | 1 - tonic/Cargo.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/tonic-reflection/Cargo.toml b/tonic-reflection/Cargo.toml index 85b498276..7686c1e70 100644 --- a/tonic-reflection/Cargo.toml +++ b/tonic-reflection/Cargo.toml @@ -19,7 +19,6 @@ rust-version = { workspace = true } [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] [features] server = ["dep:prost-types", "dep:tokio", "dep:tokio-stream"] diff --git a/tonic/Cargo.toml b/tonic/Cargo.toml index a5ac98bd5..95f929333 100644 --- a/tonic/Cargo.toml +++ b/tonic/Cargo.toml @@ -108,7 +108,6 @@ workspace = true [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] [package.metadata.cargo_check_external_types] allowed_external_types = [ From 7b2984cd252707a1fccae00909ccab0cdb3aeeb0 Mon Sep 17 00:00:00 2001 From: Adam Basfop Cavendish Date: Wed, 26 Mar 2025 02:27:05 +0800 Subject: [PATCH 37/61] feat(transport): add support for uds, unix domain socket (#2218) * feat(transport): add support for uds, unix domain socket (#2218) Previously the uds support lives as an example in the `example/src/uds` folder. Endpoint is refactored to support multiple endpoint types, including Uri and Uds. The supported unix domain socket URI follows RFC-3986 which is aligned with the gRPC naming convention. - unix:relative_path - unix:///absolute_path References: - https://datatracker.ietf.org/doc/html/rfc3986 - https://github.com/grpc/grpc/blob/master/doc/naming.md * fix feature flag error * fix windows build * fix windows build 2 * fix windows build 3 * fix windows build 4 * fix windows build 5 --------- Co-authored-by: Lucio Franco --- examples/Cargo.toml | 9 +- examples/src/uds/client_standard.rs | 34 ++++ .../{client.rs => client_with_connector.rs} | 0 tests/default_stubs/Cargo.toml | 1 + tests/default_stubs/src/test_defaults.rs | 86 +++++++-- tonic/src/transport/channel/endpoint.rs | 168 +++++++++++++----- tonic/src/transport/channel/mod.rs | 1 + .../transport/channel/service/connection.rs | 4 +- tonic/src/transport/channel/uds_connector.rs | 80 +++++++++ tonic/src/transport/error.rs | 4 + 10 files changed, 330 insertions(+), 57 deletions(-) create mode 100644 examples/src/uds/client_standard.rs rename examples/src/uds/{client.rs => client_with_connector.rs} (100%) create mode 100644 tonic/src/transport/channel/uds_connector.rs diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 0b868776c..5282863d8 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -118,8 +118,13 @@ path = "src/tracing/server.rs" required-features = ["tracing"] [[bin]] -name = "uds-client" -path = "src/uds/client.rs" +name = "uds-client-standard" +path = "src/uds/client_standard.rs" +required-features = ["uds"] + +[[bin]] +name = "uds-client-with-connector" +path = "src/uds/client_with_connector.rs" required-features = ["uds"] [[bin]] diff --git a/examples/src/uds/client_standard.rs b/examples/src/uds/client_standard.rs new file mode 100644 index 000000000..264d41cfc --- /dev/null +++ b/examples/src/uds/client_standard.rs @@ -0,0 +1,34 @@ +#![cfg_attr(not(unix), allow(unused_imports))] + +pub mod hello_world { + tonic::include_proto!("helloworld"); +} + +use hello_world::{greeter_client::GreeterClient, HelloRequest}; + +#[cfg(unix)] +#[tokio::main] +async fn main() -> Result<(), Box> { + // Unix socket URI follows [RFC-3986](https://datatracker.ietf.org/doc/html/rfc3986) + // which is aligned with [the gRPC naming convention](https://github.com/grpc/grpc/blob/master/doc/naming.md). + // - unix:relative_path + // - unix:///absolute_path + let path = "unix:///tmp/tonic/helloworld"; + + let mut client = GreeterClient::connect(path).await?; + + let request = tonic::Request::new(HelloRequest { + name: "Tonic".into(), + }); + + let response = client.say_hello(request).await?; + + println!("RESPONSE={:?}", response); + + Ok(()) +} + +#[cfg(not(unix))] +fn main() { + panic!("The `uds` example only works on unix systems!"); +} diff --git a/examples/src/uds/client.rs b/examples/src/uds/client_with_connector.rs similarity index 100% rename from examples/src/uds/client.rs rename to examples/src/uds/client_with_connector.rs diff --git a/tests/default_stubs/Cargo.toml b/tests/default_stubs/Cargo.toml index 9a786f116..2207e8fb2 100644 --- a/tests/default_stubs/Cargo.toml +++ b/tests/default_stubs/Cargo.toml @@ -8,6 +8,7 @@ name = "default_stubs" tokio = {version = "1.0", features = ["macros", "rt-multi-thread", "net"]} tokio-stream = {version = "0.1", features = ["net"]} prost = "0.13" +rand = "0.8" tonic = {path = "../../tonic"} [build-dependencies] diff --git a/tests/default_stubs/src/test_defaults.rs b/tests/default_stubs/src/test_defaults.rs index 32bed1be1..7b84d9e80 100644 --- a/tests/default_stubs/src/test_defaults.rs +++ b/tests/default_stubs/src/test_defaults.rs @@ -1,8 +1,13 @@ #![allow(unused_imports)] +use crate::test_client::TestClient; use crate::*; +use rand::Rng as _; +use std::env; +use std::fs; use std::net::SocketAddr; use tokio::net::TcpListener; +use tonic::transport::Channel; use tonic::transport::Server; #[cfg(test)] @@ -10,16 +15,14 @@ fn echo_requests_iter() -> impl Stream { tokio_stream::iter(1..usize::MAX).map(|_| ()) } -#[tokio::test()] -async fn test_default_stubs() { +#[cfg(test)] +async fn test_default_stubs( + mut client: TestClient, + mut client_default_stubs: TestClient, +) { use tonic::Code; - let addrs = run_services_in_background().await; - // First validate pre-existing functionality (trait has no default implementation, we explicitly return PermissionDenied in lib.rs). - let mut client = test_client::TestClient::connect(format!("http://{}", addrs.0)) - .await - .unwrap(); assert_eq!( client.unary(()).await.unwrap_err().code(), Code::PermissionDenied @@ -46,9 +49,6 @@ async fn test_default_stubs() { ); // Then validate opt-in new functionality (trait has default implementation of returning Unimplemented). - let mut client_default_stubs = test_client::TestClient::connect(format!("http://{}", addrs.1)) - .await - .unwrap(); assert_eq!( client_default_stubs.unary(()).await.unwrap_err().code(), Code::Unimplemented @@ -79,6 +79,27 @@ async fn test_default_stubs() { ); } +#[tokio::test()] +async fn test_default_stubs_tcp() { + let addrs = run_services_in_background().await; + let client = test_client::TestClient::connect(format!("http://{}", addrs.0)) + .await + .unwrap(); + let client_default_stubs = test_client::TestClient::connect(format!("http://{}", addrs.1)) + .await + .unwrap(); + test_default_stubs(client, client_default_stubs).await; +} + +#[tokio::test()] +#[cfg(not(target_os = "windows"))] +async fn test_default_stubs_uds() { + let addrs = run_services_in_background_uds().await; + let client = test_client::TestClient::connect(addrs.0).await.unwrap(); + let client_default_stubs = test_client::TestClient::connect(addrs.1).await.unwrap(); + test_default_stubs(client, client_default_stubs).await; +} + #[cfg(test)] async fn run_services_in_background() -> (SocketAddr, SocketAddr) { let svc = test_server::TestServer::new(Svc {}); @@ -110,3 +131,48 @@ async fn run_services_in_background() -> (SocketAddr, SocketAddr) { (addr, addr_default_stubs) } + +#[cfg(all(test, not(target_os = "windows")))] +async fn run_services_in_background_uds() -> (String, String) { + use tokio::net::UnixListener; + + let svc = test_server::TestServer::new(Svc {}); + let svc_default_stubs = test_default_server::TestDefaultServer::new(Svc {}); + + let mut rng = rand::thread_rng(); + let suffix: String = (0..8) + .map(|_| rng.sample(rand::distributions::Alphanumeric) as char) + .collect(); + let tmpdir = fs::canonicalize(env::temp_dir()) + .unwrap() + .join(format!("tonic_test_{}", suffix)); + fs::create_dir(&tmpdir).unwrap(); + + let uds_filepath = tmpdir.join("impl.sock").to_str().unwrap().to_string(); + let listener = UnixListener::bind(uds_filepath.as_str()).unwrap(); + let uds_addr = format!("unix://{}", uds_filepath); + + let uds_default_stubs_filepath = tmpdir.join("stub.sock").to_str().unwrap().to_string(); + let listener_default_stubs = UnixListener::bind(uds_default_stubs_filepath.as_str()).unwrap(); + let uds_default_stubs_addr = format!("unix://{}", uds_default_stubs_filepath); + + tokio::spawn(async move { + Server::builder() + .add_service(svc) + .serve_with_incoming(tokio_stream::wrappers::UnixListenerStream::new(listener)) + .await + .unwrap(); + }); + + tokio::spawn(async move { + Server::builder() + .add_service(svc_default_stubs) + .serve_with_incoming(tokio_stream::wrappers::UnixListenerStream::new( + listener_default_stubs, + )) + .await + .unwrap(); + }); + + (uds_addr, uds_default_stubs_addr) +} diff --git a/tonic/src/transport/channel/endpoint.rs b/tonic/src/transport/channel/endpoint.rs index 16934f34f..3a919e93d 100644 --- a/tonic/src/transport/channel/endpoint.rs +++ b/tonic/src/transport/channel/endpoint.rs @@ -1,23 +1,33 @@ #[cfg(feature = "_tls-any")] use super::service::TlsConnector; use super::service::{self, Executor, SharedExec}; +use super::uds_connector::UdsConnector; use super::Channel; #[cfg(feature = "_tls-any")] use super::ClientTlsConfig; +#[cfg(feature = "_tls-any")] +use crate::transport::error; use crate::transport::Error; use bytes::Bytes; use http::{uri::Uri, HeaderValue}; use hyper::rt; use hyper_util::client::legacy::connect::HttpConnector; -use std::{fmt, future::Future, net::IpAddr, pin::Pin, str::FromStr, time::Duration}; +use std::{fmt, future::Future, net::IpAddr, pin::Pin, str, str::FromStr, time::Duration}; use tower_service::Service; +#[derive(Clone, PartialEq, Eq, Hash)] +pub(crate) enum EndpointType { + Uri(Uri), + Uds(String), +} + /// Channel builder. /// /// This struct is used to build and configure HTTP/2 channels. #[derive(Clone)] pub struct Endpoint { - pub(crate) uri: Uri, + pub(crate) uri: EndpointType, + fallback_uri: Uri, pub(crate) origin: Option, pub(crate) user_agent: Option, pub(crate) timeout: Option, @@ -51,13 +61,68 @@ impl Endpoint { { let me = dst.try_into().map_err(|e| Error::from_source(e.into()))?; #[cfg(feature = "_tls-any")] - if me.uri.scheme() == Some(&http::uri::Scheme::HTTPS) { - return me.tls_config(ClientTlsConfig::new().with_enabled_roots()); + if let EndpointType::Uri(uri) = &me.uri { + if uri.scheme() == Some(&http::uri::Scheme::HTTPS) { + return me.tls_config(ClientTlsConfig::new().with_enabled_roots()); + } } - Ok(me) } + fn new_uri(uri: Uri) -> Self { + Self { + uri: EndpointType::Uri(uri.clone()), + fallback_uri: uri, + origin: None, + user_agent: None, + concurrency_limit: None, + rate_limit: None, + timeout: None, + #[cfg(feature = "_tls-any")] + tls: None, + buffer_size: None, + init_stream_window_size: None, + init_connection_window_size: None, + tcp_keepalive: None, + tcp_nodelay: true, + http2_keep_alive_interval: None, + http2_keep_alive_timeout: None, + http2_keep_alive_while_idle: None, + http2_max_header_list_size: None, + connect_timeout: None, + http2_adaptive_window: None, + executor: SharedExec::tokio(), + local_address: None, + } + } + + fn new_uds(uds_filepath: &str) -> Self { + Self { + uri: EndpointType::Uds(uds_filepath.to_string()), + fallback_uri: Uri::from_static("http://tonic"), + origin: None, + user_agent: None, + concurrency_limit: None, + rate_limit: None, + timeout: None, + #[cfg(feature = "_tls-any")] + tls: None, + buffer_size: None, + init_stream_window_size: None, + init_connection_window_size: None, + tcp_keepalive: None, + tcp_nodelay: true, + http2_keep_alive_interval: None, + http2_keep_alive_timeout: None, + http2_keep_alive_while_idle: None, + http2_max_header_list_size: None, + connect_timeout: None, + http2_adaptive_window: None, + executor: SharedExec::tokio(), + local_address: None, + } + } + /// Convert an `Endpoint` from a static string. /// /// # Panics @@ -69,8 +134,16 @@ impl Endpoint { /// Endpoint::from_static("https://example.com"); /// ``` pub fn from_static(s: &'static str) -> Self { - let uri = Uri::from_static(s); - Self::from(uri) + if s.starts_with("unix:") { + let uds_filepath = s + .strip_prefix("unix://") + .or_else(|| s.strip_prefix("unix:")) + .expect("Invalid unix domain socket URI"); + Self::new_uds(uds_filepath) + } else { + let uri = Uri::from_static(s); + Self::new_uri(uri) + } } /// Convert an `Endpoint` from shared bytes. @@ -80,8 +153,19 @@ impl Endpoint { /// Endpoint::from_shared("https://example.com".to_string()); /// ``` pub fn from_shared(s: impl Into) -> Result { - let uri = Uri::from_maybe_shared(s.into()).map_err(|e| Error::new_invalid_uri().with(e))?; - Ok(Self::from(uri)) + let s = str::from_utf8(&s.into()) + .map_err(|e| Error::new_invalid_uri().with(e))? + .to_string(); + if s.starts_with("unix:") { + let uds_filepath = s + .strip_prefix("unix://") + .or_else(|| s.strip_prefix("unix:")) + .ok_or(Error::new_invalid_uri())?; + Ok(Self::new_uds(uds_filepath)) + } else { + let uri = Uri::from_maybe_shared(s).map_err(|e| Error::new_invalid_uri().with(e))?; + Ok(Self::from(uri)) + } } /// Set a custom user-agent header. @@ -247,14 +331,17 @@ impl Endpoint { /// Configures TLS for the endpoint. #[cfg(feature = "_tls-any")] pub fn tls_config(self, tls_config: ClientTlsConfig) -> Result { - Ok(Endpoint { - tls: Some( - tls_config - .into_tls_connector(&self.uri) - .map_err(Error::from_source)?, - ), - ..self - }) + match &self.uri { + EndpointType::Uri(uri) => Ok(Endpoint { + tls: Some( + tls_config + .into_tls_connector(uri) + .map_err(Error::from_source)?, + ), + ..self + }), + EndpointType::Uds(_) => Err(Error::new(error::Kind::InvalidTlsConfigForUds)), + } } /// Set the value of `TCP_NODELAY` option for accepted connections. Enabled by default. @@ -346,9 +433,18 @@ impl Endpoint { self.connector(http) } + pub(crate) fn uds_connector(&self, uds_filepath: &str) -> service::Connector { + self.connector(UdsConnector::new(uds_filepath)) + } + /// Create a channel from this config. pub async fn connect(&self) -> Result { - Channel::connect(self.http_connector(), self.clone()).await + match &self.uri { + EndpointType::Uri(_) => Channel::connect(self.http_connector(), self.clone()).await, + EndpointType::Uds(uds_filepath) => { + Channel::connect(self.uds_connector(uds_filepath.as_str()), self.clone()).await + } + } } /// Create a channel from this config. @@ -356,7 +452,12 @@ impl Endpoint { /// The channel returned by this method does not attempt to connect to the endpoint until first /// use. pub fn connect_lazy(&self) -> Channel { - Channel::new(self.http_connector(), self.clone()) + match &self.uri { + EndpointType::Uri(_) => Channel::new(self.http_connector(), self.clone()), + EndpointType::Uds(uds_filepath) => { + Channel::new(self.uds_connector(uds_filepath.as_str()), self.clone()) + } + } } /// Connect with a custom connector. @@ -418,7 +519,10 @@ impl Endpoint { /// assert_eq!(endpoint.uri(), &Uri::from_static("https://example.com")); /// ``` pub fn uri(&self) -> &Uri { - &self.uri + match &self.uri { + EndpointType::Uri(uri) => uri, + EndpointType::Uds(_) => &self.fallback_uri, + } } /// Get the value of `TCP_NODELAY` option for accepted connections. @@ -443,29 +547,7 @@ impl Endpoint { impl From for Endpoint { fn from(uri: Uri) -> Self { - Self { - uri, - origin: None, - user_agent: None, - concurrency_limit: None, - rate_limit: None, - timeout: None, - #[cfg(feature = "_tls-any")] - tls: None, - buffer_size: None, - init_stream_window_size: None, - init_connection_window_size: None, - tcp_keepalive: None, - tcp_nodelay: true, - http2_keep_alive_interval: None, - http2_keep_alive_timeout: None, - http2_keep_alive_while_idle: None, - http2_max_header_list_size: None, - connect_timeout: None, - http2_adaptive_window: None, - executor: SharedExec::tokio(), - local_address: None, - } + Self::new_uri(uri) } } diff --git a/tonic/src/transport/channel/mod.rs b/tonic/src/transport/channel/mod.rs index 85f1ee51c..fe8458fab 100644 --- a/tonic/src/transport/channel/mod.rs +++ b/tonic/src/transport/channel/mod.rs @@ -4,6 +4,7 @@ mod endpoint; pub(crate) mod service; #[cfg(feature = "_tls-any")] mod tls; +mod uds_connector; pub use self::service::Change; pub use endpoint::Endpoint; diff --git a/tonic/src/transport/channel/service/connection.rs b/tonic/src/transport/channel/service/connection.rs index 4e84ac92e..c4ce9408e 100644 --- a/tonic/src/transport/channel/service/connection.rs +++ b/tonic/src/transport/channel/service/connection.rs @@ -57,7 +57,7 @@ impl Connection { let stack = ServiceBuilder::new() .layer_fn(|s| { - let origin = endpoint.origin.as_ref().unwrap_or(&endpoint.uri).clone(); + let origin = endpoint.origin.as_ref().unwrap_or(endpoint.uri()).clone(); AddOrigin::new(s, origin) }) @@ -70,7 +70,7 @@ impl Connection { let make_service = MakeSendRequestService::new(connector, endpoint.executor.clone(), settings); - let conn = Reconnect::new(make_service, endpoint.uri.clone(), is_lazy); + let conn = Reconnect::new(make_service, endpoint.uri().clone(), is_lazy); Self { inner: BoxService::new(stack.layer(conn)), diff --git a/tonic/src/transport/channel/uds_connector.rs b/tonic/src/transport/channel/uds_connector.rs new file mode 100644 index 000000000..a67c4a47c --- /dev/null +++ b/tonic/src/transport/channel/uds_connector.rs @@ -0,0 +1,80 @@ +use std::future::Future; +use std::pin::Pin; +use std::task::{Context, Poll}; + +use http::Uri; +use hyper_util::rt::TokioIo; + +use tower::Service; + +use crate::status::ConnectError; + +#[cfg(not(target_os = "windows"))] +use tokio::net::UnixStream; + +#[cfg(not(target_os = "windows"))] +async fn connect_uds(uds_path: String) -> Result { + UnixStream::connect(uds_path) + .await + .map_err(|err| ConnectError(From::from(err))) +} + +// Dummy type that will allow us to compile and match trait bounds +// but is never used. +#[cfg(target_os = "windows")] +#[allow(dead_code)] +type UnixStream = tokio::io::DuplexStream; + +#[cfg(target_os = "windows")] +async fn connect_uds(_uds_path: String) -> Result { + Err(ConnectError( + "uds connections are not allowed on windows".into(), + )) +} + +pub(crate) struct UdsConnector { + uds_filepath: String, +} + +impl UdsConnector { + pub(crate) fn new(uds_filepath: &str) -> Self { + UdsConnector { + uds_filepath: uds_filepath.to_string(), + } + } +} + +impl Service for UdsConnector { + type Response = TokioIo; + type Error = ConnectError; + type Future = UdsConnecting; + + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn call(&mut self, _: Uri) -> Self::Future { + let uds_path = self.uds_filepath.clone(); + let fut = async move { + let stream = connect_uds(uds_path).await?; + Ok(TokioIo::new(stream)) + }; + UdsConnecting { + inner: Box::pin(fut), + } + } +} + +type ConnectResult = Result, ConnectError>; + +pub(crate) struct UdsConnecting { + inner: Pin + Send>>, +} + +impl Future for UdsConnecting { + type Output = ConnectResult; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + self.get_mut().inner.as_mut().poll(cx) + } +} diff --git a/tonic/src/transport/error.rs b/tonic/src/transport/error.rs index cdc7a6c54..31b317521 100644 --- a/tonic/src/transport/error.rs +++ b/tonic/src/transport/error.rs @@ -19,6 +19,8 @@ pub(crate) enum Kind { InvalidUri, #[cfg(feature = "channel")] InvalidUserAgent, + #[cfg(all(feature = "_tls-any", feature = "channel"))] + InvalidTlsConfigForUds, } impl Error { @@ -54,6 +56,8 @@ impl Error { Kind::InvalidUri => "invalid URI", #[cfg(feature = "channel")] Kind::InvalidUserAgent => "user agent is not a valid header value", + #[cfg(all(feature = "_tls-any", feature = "channel"))] + Kind::InvalidTlsConfigForUds => "cannot apply TLS config for unix domain socket", } } } From 8be906daae10766b24a66cd5d62834f58b8ecc35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=81abor?= Date: Tue, 25 Mar 2025 14:49:19 -0400 Subject: [PATCH 38/61] Handle stream error correctly (#2199) Co-authored-by: Lucio Franco --- tests/integration_tests/tests/status.rs | 90 +++++++++++++++++++++++++ tonic/src/codec/decode.rs | 10 ++- 2 files changed, 94 insertions(+), 6 deletions(-) diff --git a/tests/integration_tests/tests/status.rs b/tests/integration_tests/tests/status.rs index 84337d130..d75052b80 100644 --- a/tests/integration_tests/tests/status.rs +++ b/tests/integration_tests/tests/status.rs @@ -6,9 +6,12 @@ use integration_tests::pb::{ test_client, test_server, test_stream_client, test_stream_server, Input, InputStream, Output, OutputStream, }; +use integration_tests::BoxFuture; use std::error::Error; +use std::task::{Context, Poll}; use std::time::Duration; use tokio::{net::TcpListener, sync::oneshot}; +use tonic::body::Body; use tonic::metadata::{MetadataMap, MetadataValue}; use tonic::{ transport::{server::TcpIncoming, Endpoint, Server}, @@ -209,6 +212,93 @@ async fn status_from_server_stream_with_source() { source.downcast_ref::().unwrap(); } +#[tokio::test] +async fn status_from_server_stream_with_inferred_status() { + integration_tests::trace_init(); + + struct Svc; + + #[tonic::async_trait] + impl test_stream_server::TestStream for Svc { + type StreamCallStream = Stream; + + async fn stream_call( + &self, + _: Request, + ) -> Result, Status> { + let s = tokio_stream::once(Ok(OutputStream {})); + Ok(Response::new(Box::pin(s) as Self::StreamCallStream)) + } + } + + #[derive(Clone)] + struct TestLayer; + + impl tower::Layer for TestLayer { + type Service = TestService; + + fn layer(&self, _: S) -> Self::Service { + TestService + } + } + + #[derive(Clone)] + struct TestService; + + impl tower::Service> for TestService { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture<'static, Result>; + + fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn call(&mut self, _: http::Request) -> Self::Future { + Box::pin(async { + Ok(http::Response::builder() + .status(http::StatusCode::BAD_GATEWAY) + .body(Body::empty()) + .unwrap()) + }) + } + } + + let svc = test_stream_server::TestStreamServer::new(Svc); + + let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); + let addr = listener.local_addr().unwrap(); + let incoming: TcpIncoming = TcpIncoming::from(listener).with_nodelay(Some(true)); + + tokio::spawn(async move { + Server::builder() + .layer(TestLayer) + .add_service(svc) + .serve_with_incoming(incoming) + .await + .unwrap(); + }); + + tokio::time::sleep(Duration::from_millis(100)).await; + + let mut client = test_stream_client::TestStreamClient::connect(format!("http://{addr}")) + .await + .unwrap(); + + let mut stream = client + .stream_call(InputStream {}) + .await + .unwrap() + .into_inner(); + + assert_eq!( + stream.message().await.unwrap_err().code(), + Code::Unavailable + ); + + assert_eq!(stream.message().await.unwrap(), None); +} + #[tokio::test] async fn message_and_then_status_from_server_stream() { integration_tests::trace_init(); diff --git a/tonic/src/codec/decode.rs b/tonic/src/codec/decode.rs index 1e6876fc8..4742291fd 100644 --- a/tonic/src/codec/decode.rs +++ b/tonic/src/codec/decode.rs @@ -400,14 +400,12 @@ impl Stream for Streaming { } if ready!(self.inner.poll_frame(cx))?.is_none() { - break; + match self.inner.response() { + Ok(()) => return Poll::Ready(None), + Err(err) => self.inner.state = State::Error(Some(err)), + } } } - - Poll::Ready(match self.inner.response() { - Ok(()) => None, - Err(err) => Some(Err(err)), - }) } } From 7ef5f6fe1f2caf1b2acd64cf5383b5501af20450 Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 26 Mar 2025 06:35:33 +0900 Subject: [PATCH 39/61] chore: Remove resolved cargo-deny config (#2230) --- deny.toml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/deny.toml b/deny.toml index 5dda4ae3e..451910f87 100644 --- a/deny.toml +++ b/deny.toml @@ -49,17 +49,3 @@ allow = [ "MPL-2.0", "BSD-3-Clause", ] - -[[licenses.clarify]] -crate = "ring" -# SPDX considers OpenSSL to encompass both the OpenSSL and SSLeay licenses -# https://spdx.org/licenses/OpenSSL.html -# ISC - Both BoringSSL and ring use this for their new files -# MIT - "Files in third_party/ have their own licenses, as described therein. The MIT -# license, for third_party/fiat, which, unlike other third_party directories, is -# compiled into non-test libraries, is included below." -# OpenSSL - Obviously -expression = "ISC AND MIT AND OpenSSL" -license-files = [ - { path = "LICENSE", hash = 0xbd0eed23 }, -] From af5ef5f7c4a5609d0292307d629b9fd08581558a Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Thu, 3 Apr 2025 07:59:28 -0700 Subject: [PATCH 40/61] Create place for grpc crate and initial contents (#2192) * Create place for grpc crate and initial contents * Cargo.toml fixes * clippy * clippy 2 * 3 --- Cargo.toml | 1 + grpc/Cargo.toml | 11 + grpc/LICENSE | 202 +++++++++++++ grpc/NOTICE.txt | 13 + grpc/src/attributes.rs | 22 ++ .../client/load_balancing/child_manager.rs | 256 +++++++++++++++++ grpc/src/client/load_balancing/mod.rs | 267 ++++++++++++++++++ grpc/src/client/mod.rs | 41 +++ grpc/src/client/name_resolution/mod.rs | 189 +++++++++++++ grpc/src/client/service.rs | 23 ++ grpc/src/client/service_config.rs | 22 ++ grpc/src/lib.rs | 31 ++ 12 files changed, 1078 insertions(+) create mode 100644 grpc/Cargo.toml create mode 100644 grpc/LICENSE create mode 100644 grpc/NOTICE.txt create mode 100644 grpc/src/attributes.rs create mode 100644 grpc/src/client/load_balancing/child_manager.rs create mode 100644 grpc/src/client/load_balancing/mod.rs create mode 100644 grpc/src/client/mod.rs create mode 100644 grpc/src/client/name_resolution/mod.rs create mode 100644 grpc/src/client/service.rs create mode 100644 grpc/src/client/service_config.rs create mode 100644 grpc/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 153316e60..351e1824f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ members = [ "tonic-web", # Non-published crates "examples", "codegen", + "grpc", "interop", # Tests "tests/disable_comments", "tests/included_service", diff --git a/grpc/Cargo.toml b/grpc/Cargo.toml new file mode 100644 index 000000000..b27942297 --- /dev/null +++ b/grpc/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "grpc" +version = "0.9.0-alpha.1" +edition = "2021" +authors = ["gRPC Authors"] +license = "Apache-2.0" + +[dependencies] +url = "2.5.0" +tokio = { version = "1.37.0", features = ["sync"] } +tonic = { version = "0.13.0", path = "../tonic", default-features = false, features = ["codegen"] } diff --git a/grpc/LICENSE b/grpc/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/grpc/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/grpc/NOTICE.txt b/grpc/NOTICE.txt new file mode 100644 index 000000000..88316812f --- /dev/null +++ b/grpc/NOTICE.txt @@ -0,0 +1,13 @@ +Copyright 2025 gRPC authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/grpc/src/attributes.rs b/grpc/src/attributes.rs new file mode 100644 index 000000000..0e1c72468 --- /dev/null +++ b/grpc/src/attributes.rs @@ -0,0 +1,22 @@ +/* + * + * Copyright 2025 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/// A key-value store for arbitrary configuration data between multiple +/// pluggable components. +#[derive(Debug, Default, Clone)] +pub struct Attributes; diff --git a/grpc/src/client/load_balancing/child_manager.rs b/grpc/src/client/load_balancing/child_manager.rs new file mode 100644 index 000000000..10cdc11ef --- /dev/null +++ b/grpc/src/client/load_balancing/child_manager.rs @@ -0,0 +1,256 @@ +/* + * + * Copyright 2025 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +//! A utility which helps parent LB policies manage multiple children for the +//! purposes of forwarding channel updates. + +// TODO: This is mainly provided as a fairly complex example of the current LB +// policy in use. Complete tests must be written before it can be used in +// production. Also, support for the work scheduler is missing. + +use std::{collections::HashMap, error::Error, hash::Hash, mem, sync::Arc}; + +use crate::client::load_balancing::{ + ChannelController, LbConfig, LbPolicy, LbPolicyBuilder, LbPolicyOptions, LbState, WorkScheduler, +}; +use crate::client::name_resolution::{Address, ResolverUpdate}; + +use super::{Subchannel, SubchannelState}; + +// An LbPolicy implementation that manages multiple children. +pub struct ChildManager { + subchannel_child_map: HashMap, + children: Vec>, + shard_update: Box>, +} + +struct Child { + identifier: T, + policy: Box, + state: LbState, +} + +/// A collection of data sent to a child of the ChildManager. +pub struct ChildUpdate { + /// The identifier the ChildManager should use for this child. + pub child_identifier: T, + /// The builder the ChildManager should use to create this child if it does + /// not exist. + pub child_policy_builder: Box, + /// The relevant ResolverUpdate to send to this child. + pub child_update: ResolverUpdate, +} + +// TODO: convert to a trait? +/// Performs the operation of sharding an aggregate ResolverUpdate into one or +/// more ChildUpdates. Called automatically by the ChildManager when its +/// resolver_update method is called. +pub type ResolverUpdateSharder = + fn( + ResolverUpdate, + ) -> Result>>, Box>; + +impl ChildManager { + /// Creates a new ChildManager LB policy. shard_update is called whenever a + /// resolver_update operation occurs. + pub fn new(shard_update: Box>) -> Self { + Self { + subchannel_child_map: HashMap::default(), + children: Vec::default(), + shard_update, + } + } + + /// Returns data for all current children. + pub fn child_states(&mut self) -> impl Iterator { + self.children + .iter() + .map(|child| (&child.identifier, &child.state)) + } + + // Called to update all accounting in the ChildManager from operations + // performed by a child policy on the WrappedController that was created for + // it. child_idx is an index into the children map for the relevant child. + // + // TODO: this post-processing step can be eliminated by capturing the right + // state inside the WrappedController, however it is fairly complex. Decide + // which way is better. + fn resolve_child_controller( + &mut self, + channel_controller: WrappedController, + child_idx: usize, + ) { + // Add all created subchannels into the subchannel_child_map. + for csc in channel_controller.created_subchannels { + self.subchannel_child_map.insert(csc, child_idx); + } + // Update the tracked state if the child produced an update. + if let Some(state) = channel_controller.picker_update { + self.children[child_idx].state = state; + }; + } +} + +impl LbPolicy for ChildManager { + fn resolver_update( + &mut self, + resolver_update: ResolverUpdate, + config: Option<&LbConfig>, + channel_controller: &mut dyn ChannelController, + ) -> Result<(), Box> { + // First determine if the incoming update is valid. + let child_updates = (self.shard_update)(resolver_update)?; + + // Replace self.children with an empty vec. + let mut old_children = vec![]; + mem::swap(&mut self.children, &mut old_children); + + // Replace the subchannel map with an empty map. + let mut old_subchannel_child_map = HashMap::new(); + mem::swap( + &mut self.subchannel_child_map, + &mut old_subchannel_child_map, + ); + // Reverse the old subchannel map. + let mut old_child_subchannels_map: HashMap> = HashMap::new(); + for (subchannel, child_idx) in old_subchannel_child_map { + old_child_subchannels_map + .entry(child_idx) + .or_default() + .push(subchannel); + } + + // Build a map of the old children from their IDs for efficient lookups. + let old_children = old_children + .into_iter() + .enumerate() + .map(|(old_idx, e)| (e.identifier, (e.policy, e.state, old_idx))); + let mut old_children: HashMap = old_children.collect(); + + // Split the child updates into the IDs and builders, and the + // ResolverUpdates. + let (ids_builders, updates): (Vec<_>, Vec<_>) = child_updates + .map(|e| ((e.child_identifier, e.child_policy_builder), e.child_update)) + .unzip(); + + // Transfer children whose identifiers appear before and after the + // update, and create new children. Add entries back into the + // subchannel map. + for (new_idx, (identifier, builder)) in ids_builders.into_iter().enumerate() { + if let Some((policy, state, old_idx)) = old_children.remove(&identifier) { + for subchannel in old_child_subchannels_map + .remove(&old_idx) + .into_iter() + .flatten() + { + self.subchannel_child_map.insert(subchannel, new_idx); + } + self.children.push(Child { + identifier, + state, + policy, + }); + } else { + let policy = builder.build(LbPolicyOptions { + work_scheduler: Arc::new(UnimplWorkScheduler {}), + }); + let state = LbState::initial(); + self.children.push(Child { + identifier, + state, + policy, + }); + }; + } + + // Anything left in old_children will just be Dropped and cleaned up. + + // Call resolver_update on all children. + let mut updates = updates.into_iter(); + for child_idx in 0..self.children.len() { + let child = &mut self.children[child_idx]; + let child_update = updates.next().unwrap(); + let mut channel_controller = WrappedController::new(channel_controller); + let _ = child + .policy + .resolver_update(child_update, config, &mut channel_controller); + self.resolve_child_controller(channel_controller, child_idx); + } + Ok(()) + } + + fn subchannel_update( + &mut self, + subchannel: &Subchannel, + state: &SubchannelState, + channel_controller: &mut dyn ChannelController, + ) { + // Determine which child created this subchannel. + let child_idx = *self.subchannel_child_map.get(subchannel).unwrap(); + let policy = &mut self.children[child_idx].policy; + // Wrap the channel_controller to track the child's operations. + let mut channel_controller = WrappedController::new(channel_controller); + // Call the proper child. + policy.subchannel_update(subchannel, state, &mut channel_controller); + self.resolve_child_controller(channel_controller, child_idx); + } + + fn work(&mut self, _channel_controller: &mut dyn ChannelController) { + todo!(); + } +} + +struct WrappedController<'a> { + channel_controller: &'a mut dyn ChannelController, + created_subchannels: Vec, + picker_update: Option, +} + +impl<'a> WrappedController<'a> { + fn new(channel_controller: &'a mut dyn ChannelController) -> Self { + Self { + channel_controller, + created_subchannels: vec![], + picker_update: None, + } + } +} + +impl ChannelController for WrappedController<'_> { + fn new_subchannel(&mut self, address: &Address) -> Subchannel { + let subchannel = self.channel_controller.new_subchannel(address); + self.created_subchannels.push(subchannel.clone()); + subchannel + } + + fn update_picker(&mut self, update: LbState) { + self.picker_update = Some(update); + } + + fn request_resolution(&mut self) { + self.channel_controller.request_resolution(); + } +} + +pub struct UnimplWorkScheduler; + +impl WorkScheduler for UnimplWorkScheduler { + fn schedule_work(&self) { + todo!(); + } +} diff --git a/grpc/src/client/load_balancing/mod.rs b/grpc/src/client/load_balancing/mod.rs new file mode 100644 index 000000000..91b04f903 --- /dev/null +++ b/grpc/src/client/load_balancing/mod.rs @@ -0,0 +1,267 @@ +/* + * + * Copyright 2025 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +pub mod child_manager; + +use std::{any::Any, error::Error, hash::Hash, sync::Arc}; + +use tonic::{metadata::MetadataMap, Status}; + +use crate::client::{ + name_resolution::{Address, ResolverUpdate}, + service::Request, + ConnectivityState, +}; + +/// A collection of data configured on the channel that is constructing this +/// LbPolicy. +pub struct LbPolicyOptions { + /// A hook into the channel's work scheduler that allows the LbPolicy to + /// request the ability to perform operations on the ChannelController. + pub work_scheduler: Arc, +} + +/// Used to asynchronously request a call into the LbPolicy's work method if +/// the LbPolicy needs to provide an update without waiting for an update +/// from the channel first. +pub trait WorkScheduler: Send + Sync { + // Schedules a call into the LbPolicy's work method. If there is already a + // pending work call that has not yet started, this may not schedule another + // call. + fn schedule_work(&self); +} + +/// An LB policy factory that produces LbPolicy instances used by the channel +/// to manage connections and pick connections for RPCs. +pub trait LbPolicyBuilder: Send + Sync { + /// Builds and returns a new LB policy instance. + /// + /// Note that build must not fail. Any optional configuration is delivered + /// via the LbPolicy's resolver_update method. + /// + /// An LbPolicy instance is assumed to begin in a Connecting state that + /// queues RPCs until its first update. + fn build(&self, options: LbPolicyOptions) -> Box; + + /// Reports the name of the LB Policy. + fn name(&self) -> &'static str; + + /// Parses the JSON LB policy configuration into an internal representation. + /// + /// LB policies do not need to accept a configuration, in which case the + /// default implementation returns Ok(None). + fn parse_config( + &self, + _config: &str, + ) -> Result, Box> { + Ok(None) + } +} + +/// An LB policy instance. +/// +/// LB policies are responsible for creating connections (modeled as +/// Subchannels) and producing Picker instances for picking connections for +/// RPCs. +pub trait LbPolicy: Send { + /// Called by the channel when the name resolver produces a new set of + /// resolved addresses or a new service config. + fn resolver_update( + &mut self, + update: ResolverUpdate, + config: Option<&LbConfig>, + channel_controller: &mut dyn ChannelController, + ) -> Result<(), Box>; + + /// Called by the channel when any subchannel created by the LB policy + /// changes state. + fn subchannel_update( + &mut self, + subchannel: &Subchannel, + state: &SubchannelState, + channel_controller: &mut dyn ChannelController, + ); + + /// Called by the channel in response to a call from the LB policy to the + /// WorkScheduler's request_work method. + fn work(&mut self, channel_controller: &mut dyn ChannelController); +} + +/// Controls channel behaviors. +pub trait ChannelController: Send + Sync { + /// Creates a new subchannel in IDLE state. + fn new_subchannel(&mut self, address: &Address) -> Subchannel; + + /// Provides a new snapshot of the LB policy's state to the channel. + fn update_picker(&mut self, update: LbState); + + /// Signals the name resolver to attempt to re-resolve addresses. Typically + /// used when connections fail, indicating a possible change in the overall + /// network configuration. + fn request_resolution(&mut self); +} + +/// Represents the current state of a Subchannel. +#[derive(Clone)] +pub struct SubchannelState { + /// The connectivity state of the subchannel. See SubChannel for a + /// description of the various states and their valid transitions. + pub connectivity_state: ConnectivityState, + // Set if connectivity state is TransientFailure to describe the most recent + // connection error. None for any other connectivity_state value. + pub last_connection_error: Option>, +} + +/// A convenience wrapper for an LB policy's configuration object. +pub struct LbConfig { + config: Box, +} + +impl LbConfig { + /// Create a new LbConfig wrapper containing the provided config. + pub fn new(config: Box) -> Self { + LbConfig { config } + } + + /// Converts the wrapped configuration into the type used by the LbPolicy. + pub fn into(&self) -> Option<&T> { + self.config.downcast_ref::() + } +} + +/// A Picker is responsible for deciding what Subchannel to use for any given +/// request. A Picker is only used once for any RPC. If pick() returns Queue, +/// the channel will queue the RPC until a new Picker is produced by the +/// LbPolicy, and will call pick() on the new Picker for the request. +/// +/// Pickers are always paired with a ConnectivityState which the channel will +/// expose to applications so they can predict what might happens when +/// performing RPCs: +/// +/// If the ConnectivityState is Idle, the Picker should ensure connections are +/// initiated by the LbPolicy that produced the Picker, and return a Queue +/// result so the request is attempted the next time a Picker is produced. +/// +/// If the ConnectivityState is Connecting, the Picker should return a Queue +/// result and continue to wait for pending connections. +/// +/// If the ConnectivityState is Ready, the Picker should return a Ready +/// Subchannel. +/// +/// If the ConnectivityState is TransientFailure, the Picker should return an +/// Err with an error that describes why connections are failing. +pub trait Picker: Send + Sync { + /// Picks a connection to use for the request. + /// + /// This function should not block. If the Picker needs to do blocking or + /// time-consuming work to service this request, it should return Queue, and + /// the Pick call will be repeated by the channel when a new Picker is + /// produced by the LbPolicy. + fn pick(&self, request: &Request) -> PickResult; +} + +pub enum PickResult { + /// Indicates the Subchannel in the Pick should be used for the request. + Pick(Pick), + /// Indicates the LbPolicy is attempting to connect to a server to use for + /// the request. + Queue, + /// Indicates that the request should fail with the included error status + /// (with the code converted to UNAVAILABLE). If the RPC is wait-for-ready, + /// then it will not be terminated, but instead attempted on a new picker if + /// one is produced before it is cancelled. + Fail(Status), + /// Indicates that the request should fail with the included status + /// immediately, even if the RPC is wait-for-ready. The channel will + /// convert the status code to INTERNAL if it is not a valid code for the + /// gRPC library to produce, per [gRFC A54]. + /// + /// [gRFC A54]: + /// https://github.com/grpc/proposal/blob/master/A54-restrict-control-plane-status-codes.md + Drop(Status), +} + +/// Data provided by the LB policy. +#[derive(Clone)] +pub struct LbState { + pub connectivity_state: super::ConnectivityState, + pub picker: Arc, +} + +impl LbState { + /// Returns a generic initial LbState which is Connecting and a picker which + /// queues all picks. + pub fn initial() -> Self { + Self { + connectivity_state: ConnectivityState::Connecting, + picker: Arc::new(QueuingPicker {}), + } + } +} + +/// A collection of data used by the channel for routing a request. +pub struct Pick { + /// The Subchannel for the request. + pub subchannel: Subchannel, + // Metadata to be added to existing outgoing metadata. + pub metadata: MetadataMap, +} + +/// A Subchannel represents a method of communicating with a server which may be +/// connected or disconnected many times across its lifetime. +/// +/// - Subchannels start IDLE. +/// +/// - IDLE transitions to CONNECTING when connect() is called. +/// +/// - CONNECTING transitions to READY on success or TRANSIENT_FAILURE on error. +/// +/// - READY transitions to IDLE when the connection is lost. +/// +/// - TRANSIENT_FAILURE transitions to CONNECTING when the reconnect backoff +/// timer has expired. This timer scales exponentially and is reset when the +/// subchannel becomes READY. +/// +/// When a Subchannel is dropped, it is disconnected, and no subsequent state +/// updates will be provided for it to the LB policy. +#[derive(Clone, Debug)] +pub struct Subchannel; + +impl Hash for Subchannel { + fn hash(&self, _state: &mut H) { + todo!() + } +} + +impl PartialEq for Subchannel { + fn eq(&self, _other: &Self) -> bool { + todo!() + } +} + +impl Eq for Subchannel {} + +/// QueuingPicker always returns Queue. LB policies that are not actively +/// Connecting should not use this picker. +pub struct QueuingPicker {} + +impl Picker for QueuingPicker { + fn pick(&self, _request: &Request) -> PickResult { + PickResult::Queue + } +} diff --git a/grpc/src/client/mod.rs b/grpc/src/client/mod.rs new file mode 100644 index 000000000..8bc693e4f --- /dev/null +++ b/grpc/src/client/mod.rs @@ -0,0 +1,41 @@ +/* + * + * Copyright 2025 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +pub(crate) mod load_balancing; +pub(crate) mod name_resolution; +pub mod service; +pub mod service_config; + +/// A representation of the current state of a gRPC channel, also used for the +/// state of subchannels (individual connections within the channel). +/// +/// A gRPC channel begins in the Idle state. When an RPC is attempted, the +/// channel will automatically transition to Connecting. If connections to a +/// backend service are available, the state becomes Ready. Otherwise, if RPCs +/// would fail due to a lack of connections, the state becomes TransientFailure +/// and continues to attempt to reconnect. +/// +/// Channels may re-enter the Idle state if they are unused for longer than +/// their configured idleness timeout. +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum ConnectivityState { + Idle, + Connecting, + Ready, + TransientFailure, +} diff --git a/grpc/src/client/name_resolution/mod.rs b/grpc/src/client/name_resolution/mod.rs new file mode 100644 index 000000000..05c5cf795 --- /dev/null +++ b/grpc/src/client/name_resolution/mod.rs @@ -0,0 +1,189 @@ +/* + * + * Copyright 2025 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +//! Name Resolution for gRPC. +//! +//! Name Resolution is the process by which a channel's target is converted into +//! network addresses (typically IP addresses) used by the channel to connect to +//! a service. +use core::fmt; + +use std::{ + error::Error, + fmt::{Display, Formatter}, + hash::Hash, + sync::Arc, +}; + +use tokio::sync::Notify; +use tonic::async_trait; +use url::Url; + +use crate::attributes::Attributes; + +use super::service_config::ServiceConfig; + +/// A name resolver factory that produces Resolver instances used by the channel +/// to resolve network addresses for the target URI. +pub trait ResolverBuilder: Send + Sync { + /// Builds and returns a new name resolver instance. + /// + /// Note that build must not fail. Instead, an erroring Resolver may be + /// returned that calls ChannelController.update() with an Err value. + fn build( + &self, + target: Url, + resolve_now: Arc, + options: ResolverOptions, + ) -> Box; + + /// Reports the URI scheme handled by this name resolver. + fn scheme(&self) -> &'static str; + + /// Returns the default authority for a channel using this name resolver and + /// target. This is typically the same as the service's name. By default, + /// the default_authority method automatically returns the path portion of + /// the target URI, with the leading prefix removed. + fn default_authority(&self, target: &Url) -> String { + let path = target.path(); + path.strip_prefix("/").unwrap_or(path).to_string() + } +} + +/// A collection of data configured on the channel that is constructing this +/// name resolver. +#[derive(Debug, Default)] +#[non_exhaustive] +pub struct ResolverOptions { + /// The authority that will be used for the channel by default. This + /// contains either the result of the default_authority method of this + /// ResolverBuilder, or another string if the channel was configured to + /// override the default. + authority: String, +} + +#[async_trait] +/// A collection of operations a Resolver may perform on the channel which +/// constructed it. +pub trait ChannelController: Send + Sync { + /// Parses the provided JSON service config. + fn parse_config(&self, config: &str) -> Result>; // TODO + + /// Notifies the channel about the current state of the name resolver. If + /// an error value is returned, the name resolver should attempt to + /// re-resolve, if possible. The resolver is responsible for applying an + /// appropriate backoff mechanism to avoid overloading the system or the + /// remote resolver. + async fn update(&self, update: ResolverUpdate) -> Result<(), Box>; +} + +/// A name resolver update expresses the current state of the resolver. +pub enum ResolverUpdate { + /// Indicates the name resolver encountered an error. + Err(Box), + /// Indicates the name resolver produced a valid result. + Data(ResolverData), +} + +/// Data provided by the name resolver to the channel. +#[derive(Debug, Default)] +#[non_exhaustive] +pub struct ResolverData { + /// A list of endpoints which each identify a logical host serving the + /// service indicated by the target URI. + pub endpoints: Vec, + /// The service config which the client should use for communicating with + /// the service. + pub service_config: Option, + // Optional data which may be used by the LB Policy or channel. + pub attributes: Attributes, +} + +/// An Endpoint is an address or a collection of addresses which reference one +/// logical server. Multiple addresses may be used if there are multiple ways +/// which the server can be reached, e.g. via IPv4 and IPv6 addresses. +#[derive(Debug, Default, Clone)] +#[non_exhaustive] +pub struct Endpoint { + /// The list of addresses used to connect to the server. + pub addresses: Vec
, + /// Optional data which may be used by the LB policy or channel. + pub attributes: Attributes, +} + +impl Eq for Endpoint {} + +impl PartialEq for Endpoint { + fn eq(&self, _other: &Self) -> bool { + todo!() + } +} + +impl Hash for Endpoint { + fn hash(&self, _state: &mut H) { + todo!() + } +} + +/// An Address is an identifier that indicates how to connect to a server. +#[derive(Debug, Default, Clone)] +#[non_exhaustive] +pub struct Address { + /// The address type is used to identify what kind of transport to create + /// when connecting to this address. Typically TCP_IP_ADDRESS_TYPE. + pub address_type: String, // TODO: &'static str? + /// The address itself is passed to the transport in order to create a + /// connection to it. + pub address: String, + // Optional data which the transport may use for the connection. + pub attributes: Attributes, +} + +impl Eq for Address {} + +impl PartialEq for Address { + fn eq(&self, _other: &Self) -> bool { + todo!() + } +} + +impl Hash for Address { + fn hash(&self, _state: &mut H) { + todo!() + } +} + +impl Display for Address { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + write!(f, "{}:{}", self.address_type, self.address) + } +} + +/// Indicates the address is an IPv4 or IPv6 address that should be connected to +/// via TCP/IP. +pub static TCP_IP_ADDRESS_TYPE: &str = "tcp"; + +/// A name resolver instance. +#[async_trait] +pub trait Resolver: Send + Sync { + /// The entry point of the resolver. Will only be called once by the + /// channel. Should not return unless the resolver never will need to + /// update its state. The future will be dropped when the channel shuts + /// down or enters idle mode. + async fn run(&mut self, channel_controller: Box); +} diff --git a/grpc/src/client/service.rs b/grpc/src/client/service.rs new file mode 100644 index 000000000..d1d3c0534 --- /dev/null +++ b/grpc/src/client/service.rs @@ -0,0 +1,23 @@ +/* + * + * Copyright 2025 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/// A gRPC Request. +pub struct Request; + +/// A gRPC Response. +pub struct Response; diff --git a/grpc/src/client/service_config.rs b/grpc/src/client/service_config.rs new file mode 100644 index 000000000..3639c03e5 --- /dev/null +++ b/grpc/src/client/service_config.rs @@ -0,0 +1,22 @@ +/* + * + * Copyright 2025 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/// An in-memory representation of a service config, usually provided to gRPC as +/// a JSON object. +#[derive(Debug, Default)] +pub(crate) struct ServiceConfig; diff --git a/grpc/src/lib.rs b/grpc/src/lib.rs new file mode 100644 index 000000000..064ce6077 --- /dev/null +++ b/grpc/src/lib.rs @@ -0,0 +1,31 @@ +/* + * + * Copyright 2025 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +//! The official Rust implementation of [gRPC], a high performance, open source, +//! universal RPC framework +//! +//! This version is in progress and not recommended for any production use. All +//! APIs are unstable. Proceed at your own risk. +//! +//! [gRPC]: https://grpc.io + +#![allow(dead_code)] + +pub mod client; + +pub(crate) mod attributes; From fee9c130c86a365b039f3e70a72a94ea28a9aaa9 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Sat, 5 Apr 2025 09:42:36 -0500 Subject: [PATCH 41/61] grpc-web: relax bounds for inner service's response body (#2245) * grpc-web: relax bounds for inner service's response body * address feedback --- tonic-web/Cargo.toml | 1 + tonic-web/src/service.rs | 39 +++++++++++++++++++++++++++------------ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/tonic-web/Cargo.toml b/tonic-web/Cargo.toml index b3301aaa4..487efe709 100644 --- a/tonic-web/Cargo.toml +++ b/tonic-web/Cargo.toml @@ -29,6 +29,7 @@ tracing = "0.1" [dev-dependencies] tokio = { version = "1", features = ["macros", "rt"] } tower-http = { version = "0.6", features = ["cors"] } +axum = { version = "0.8", default-features = false } [lints] workspace = true diff --git a/tonic-web/src/service.rs b/tonic-web/src/service.rs index a60a724ba..ab9abc0b8 100644 --- a/tonic-web/src/service.rs +++ b/tonic-web/src/service.rs @@ -43,13 +43,15 @@ impl GrpcWebService { } } -impl Service> for GrpcWebService +impl Service> for GrpcWebService where - S: Service, Response = Response>, - B: http_body::Body + Send + 'static, - B::Error: Into + fmt::Display, + S: Service, Response = Response>, + ReqBody: http_body::Body + Send + 'static, + ReqBody::Error: Into + fmt::Display, + ResBody: http_body::Body + Send + 'static, + ResBody::Error: Into + fmt::Display, { - type Response = S::Response; + type Response = Response; type Error = S::Error; type Future = ResponseFuture; @@ -57,7 +59,7 @@ where self.inner.poll_ready(cx) } - fn call(&mut self, req: Request) -> Self::Future { + fn call(&mut self, req: Request) -> Self::Future { match RequestKind::new(req.headers(), req.method(), req.version()) { // A valid grpc-web request, regardless of HTTP version. // @@ -152,9 +154,11 @@ impl Case { } } -impl Future for ResponseFuture +impl Future for ResponseFuture where - F: Future, E>>, + F: Future, E>>, + B: http_body::Body + Send + 'static, + B::Error: Into + fmt::Display, { type Output = Result, E>; @@ -167,7 +171,7 @@ where Poll::Ready(Ok(coerce_response(res, *accept))) } - CaseProj::Other { future } => future.poll(cx), + CaseProj::Other { future } => future.poll(cx).map_ok(|res| res.map(Body::new)), CaseProj::ImmediateResponse { res } => { let res = Response::from_parts(res.take().unwrap(), Body::empty()); Poll::Ready(Ok(res)) @@ -255,16 +259,16 @@ mod tests { #[derive(Debug, Clone)] struct Svc; - impl tower_service::Service> for Svc { + impl tower_service::Service> for Svc { type Response = Response; - type Error = String; + type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } - fn call(&mut self, _: Request) -> Self::Future { + fn call(&mut self, _: Request) -> Self::Future { Box::pin(async { Ok(Response::new(Body::default())) }) } } @@ -313,6 +317,17 @@ mod tests { assert_eq!(res.status(), StatusCode::OK); } + #[tokio::test] + async fn web_layer_with_axum() { + let mut svc = axum::routing::Router::new() + .route("/", axum::routing::post_service(Svc)) + .layer(crate::GrpcWebLayer::new()); + + let res = svc.call(request()).await.unwrap(); + + assert_eq!(res.status(), StatusCode::OK); + } + #[tokio::test] async fn without_origin() { let mut svc = enable(Svc); From 457ae30b5330610d20448d048c10d38d1e6d3d6b Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 7 Apr 2025 22:19:44 +0900 Subject: [PATCH 42/61] chore(test): Allow clippy::doc_overindented_list_items lint in generated code (#2246) --- tests/wellknown-compiled/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/wellknown-compiled/src/lib.rs b/tests/wellknown-compiled/src/lib.rs index 60ab404d1..3bf566eda 100644 --- a/tests/wellknown-compiled/src/lib.rs +++ b/tests/wellknown-compiled/src/lib.rs @@ -1,6 +1,7 @@ pub mod gen { pub mod google { pub mod protobuf { + #![allow(clippy::doc_overindented_list_items)] tonic::include_proto!("google.protobuf"); } } From 5ecc6071a730bebfd0fd6695c7a937737fae1965 Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 7 Apr 2025 22:21:27 +0900 Subject: [PATCH 43/61] chore(test): Update to rand 0.9 (#2236) --- tests/default_stubs/Cargo.toml | 2 +- tests/default_stubs/src/test_defaults.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/default_stubs/Cargo.toml b/tests/default_stubs/Cargo.toml index 2207e8fb2..45f1e74d1 100644 --- a/tests/default_stubs/Cargo.toml +++ b/tests/default_stubs/Cargo.toml @@ -8,7 +8,7 @@ name = "default_stubs" tokio = {version = "1.0", features = ["macros", "rt-multi-thread", "net"]} tokio-stream = {version = "0.1", features = ["net"]} prost = "0.13" -rand = "0.8" +rand = "0.9" tonic = {path = "../../tonic"} [build-dependencies] diff --git a/tests/default_stubs/src/test_defaults.rs b/tests/default_stubs/src/test_defaults.rs index 7b84d9e80..01d5e358a 100644 --- a/tests/default_stubs/src/test_defaults.rs +++ b/tests/default_stubs/src/test_defaults.rs @@ -139,9 +139,9 @@ async fn run_services_in_background_uds() -> (String, String) { let svc = test_server::TestServer::new(Svc {}); let svc_default_stubs = test_default_server::TestDefaultServer::new(Svc {}); - let mut rng = rand::thread_rng(); + let mut rng = rand::rng(); let suffix: String = (0..8) - .map(|_| rng.sample(rand::distributions::Alphanumeric) as char) + .map(|_| rng.sample(rand::distr::Alphanumeric) as char) .collect(); let tmpdir = fs::canonicalize(env::temp_dir()) .unwrap() From f04bf2923ab22589b7ab8c3ab4516036214003c1 Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 7 Apr 2025 22:21:40 +0900 Subject: [PATCH 44/61] chore(router): Remove unnecessary type converting (#2237) --- tonic/src/service/router.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tonic/src/service/router.rs b/tonic/src/service/router.rs index 1a8ae366c..848ef1cba 100644 --- a/tonic/src/service/router.rs +++ b/tonic/src/service/router.rs @@ -151,7 +151,7 @@ where #[inline] fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { - Service::>::poll_ready(&mut self.router, cx).map_err(|e| match e {}) + Service::>::poll_ready(&mut self.router, cx) } fn call(&mut self, req: Request) -> Self::Future { From 13b964383ac3ae6f49fc1e08ea1cd7204ba782ec Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 7 Apr 2025 22:21:54 +0900 Subject: [PATCH 45/61] chore(ci): Update to nightly-2025-03-27 on udeps ci (#2242) --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ee111e182..cd204d442 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -59,7 +59,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2024-12-01 + toolchain: nightly-2025-03-27 - uses: taiki-e/install-action@cargo-hack - uses: taiki-e/install-action@cargo-udeps - uses: taiki-e/install-action@protoc From 50253f1cb236feca3061488d542e37cf60ba4f65 Mon Sep 17 00:00:00 2001 From: tottoto Date: Thu, 17 Apr 2025 12:11:48 +0900 Subject: [PATCH 46/61] chore(codegen): Update to protox 0.8 (#2254) --- codegen/Cargo.toml | 2 +- deny.toml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index 9d58274b9..54c2b83b4 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -5,7 +5,7 @@ license = "MIT" edition = "2021" [dependencies] -protox = "0.7" +protox = "0.8" prettyplease = "0.2" quote = "1" syn = "2" diff --git a/deny.toml b/deny.toml index 451910f87..edbe0bc21 100644 --- a/deny.toml +++ b/deny.toml @@ -24,6 +24,8 @@ deny = [ { crate = "term" }, ] skip = [ + { crate = "thiserror@1.0.69", reason = "protox depends on miette which depends on it" }, + { crate = "thiserror-impl@1.0.69", reason = "thiserror@1.0.69 depends on it" }, { crate = "getrandom@0.2.15", reason = "quickcheck depends on rand which depends on it" }, { crate = "wasi@0.11.0+wasi-snapshot-preview1", reason = "quickcheck depends on rand which depends on it" }, { crate = "itertools@0.12.1", reason = "aws-lc-sys depends on bindgen which depends on it" }, From 55e48c0713b78e8bccb001868aec86df2dc862ab Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Wed, 23 Apr 2025 11:15:18 -0400 Subject: [PATCH 47/61] chore(ci): Remove deny job (#2255) Removing the deny ci job it has become more of a pain to manage than actually helpful. --- .github/workflows/CI.yml | 8 ------ deny.toml | 53 ---------------------------------------- 2 files changed, 61 deletions(-) delete mode 100644 deny.toml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index cd204d442..fec6cdb87 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -25,14 +25,6 @@ jobs: components: rustfmt - run: cargo fmt --all --check - deny: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: hecrj/setup-rust-action@v2 - - uses: taiki-e/install-action@cargo-deny - - run: cargo deny check - clippy: runs-on: ubuntu-latest steps: diff --git a/deny.toml b/deny.toml deleted file mode 100644 index edbe0bc21..000000000 --- a/deny.toml +++ /dev/null @@ -1,53 +0,0 @@ -[graph] -all-features = true -exclude = ["examples"] - -[advisories] -ignore = [ - { id = "RUSTSEC-2024-0436", reason = "paste crate is unmaintained. aws-lc-rs, aws-lc-sys and compression test depend on it." }, -] - -[bans] -multiple-versions = "deny" -deny = [ - # color-backtrace is nice but brings in too many dependencies and that are often outdated, so not worth it for us. - { crate = "color-backtrace" }, - - # dirs crate has a lot of dependencies and there are better alternatives - { crate = "dirs" }, - { crate = "dirs-sys" }, - - # deprecated - { crate = "quickersort" }, - - # term is not fully maintained, and termcolor is replacing it - { crate = "term" }, -] -skip = [ - { crate = "thiserror@1.0.69", reason = "protox depends on miette which depends on it" }, - { crate = "thiserror-impl@1.0.69", reason = "thiserror@1.0.69 depends on it" }, - { crate = "getrandom@0.2.15", reason = "quickcheck depends on rand which depends on it" }, - { crate = "wasi@0.11.0+wasi-snapshot-preview1", reason = "quickcheck depends on rand which depends on it" }, - { crate = "itertools@0.12.1", reason = "aws-lc-sys depends on bindgen which depends on it" }, - { crate = "unicode-width@0.1.14", reason = "protox depends on miette wich depends on it" }, - { crate = "rustix@0.38.44", reason = "aws-lc-sys depends on bindgen which depends on it" }, - { crate = "linux-raw-sys@0.4.15", reason = "rustix 0.38.44 depends on it" }, -] -skip-tree = [ - { crate = "windows-sys" }, - { crate = "hermit-abi" }, -] - -[licenses] -version = 2 -# We want really high confidence when inferring licenses from text -confidence-threshold = 0.92 -allow = [ - "Apache-2.0", - "ISC", - "MIT", - "OpenSSL", - "Unicode-3.0", - "MPL-2.0", - "BSD-3-Clause", -] From e0ea5d09c70f453f29efd2496a48f439b02c1d3f Mon Sep 17 00:00:00 2001 From: Darren Bolduc Date: Wed, 23 Apr 2025 11:08:00 -0700 Subject: [PATCH 48/61] feat: preserve request user-agent (#2250) Co-authored-by: Lucio Franco --- .../transport/channel/service/user_agent.rs | 93 ++++++++++++++++++- 1 file changed, 91 insertions(+), 2 deletions(-) diff --git a/tonic/src/transport/channel/service/user_agent.rs b/tonic/src/transport/channel/service/user_agent.rs index 7f59e90a3..bbcc1caca 100644 --- a/tonic/src/transport/channel/service/user_agent.rs +++ b/tonic/src/transport/channel/service/user_agent.rs @@ -39,8 +39,21 @@ where } fn call(&mut self, mut req: Request) -> Self::Future { - req.headers_mut() - .insert(USER_AGENT, self.user_agent.clone()); + if let Ok(Some(user_agent)) = req + .headers_mut() + .try_insert(USER_AGENT, self.user_agent.clone()) + { + // The User-Agent header has already been set on the request. Let's + // append our user agent to the end. + let mut buf = Vec::new(); + buf.extend(user_agent.as_bytes()); + buf.push(b' '); + buf.extend(self.user_agent.as_bytes()); + req.headers_mut().insert( + USER_AGENT, + HeaderValue::from_bytes(&buf).expect("user-agent should be valid"), + ); + } self.inner.call(req) } @@ -67,4 +80,80 @@ mod tests { HeaderValue::from_str(&format!("Greeter 1.1 {}", TONIC_USER_AGENT)).unwrap() ) } + + struct TestSvc { + pub expected_user_agent: String, + } + + impl Service> for TestSvc { + type Response = (); + type Error = (); + type Future = std::future::Ready>; + + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn call(&mut self, req: Request<()>) -> Self::Future { + let user_agent = req.headers().get(USER_AGENT).unwrap().to_str().unwrap(); + assert_eq!(user_agent, self.expected_user_agent); + std::future::ready(Ok(())) + } + } + + #[tokio::test] + async fn sets_default_user_agent_if_none_present() { + let expected_user_agent = TONIC_USER_AGENT.to_string(); + let mut ua = UserAgent::new( + TestSvc { + expected_user_agent, + }, + None, + ); + let _ = ua.call(Request::default()).await; + } + + #[tokio::test] + async fn sets_custom_user_agent_if_none_present() { + let expected_user_agent = format!("Greeter 1.1 {}", TONIC_USER_AGENT); + let mut ua = UserAgent::new( + TestSvc { + expected_user_agent, + }, + Some(HeaderValue::from_static("Greeter 1.1")), + ); + let _ = ua.call(Request::default()).await; + } + + #[tokio::test] + async fn appends_default_user_agent_to_request_user_agent() { + let mut req = Request::default(); + req.headers_mut() + .insert(USER_AGENT, HeaderValue::from_static("request-ua/x.y")); + + let expected_user_agent = format!("request-ua/x.y {}", TONIC_USER_AGENT); + let mut ua = UserAgent::new( + TestSvc { + expected_user_agent, + }, + None, + ); + let _ = ua.call(req).await; + } + + #[tokio::test] + async fn appends_custom_user_agent_to_request_user_agent() { + let mut req = Request::default(); + req.headers_mut() + .insert(USER_AGENT, HeaderValue::from_static("request-ua/x.y")); + + let expected_user_agent = format!("request-ua/x.y Greeter 1.1 {}", TONIC_USER_AGENT); + let mut ua = UserAgent::new( + TestSvc { + expected_user_agent, + }, + Some(HeaderValue::from_static("Greeter 1.1")), + ); + let _ = ua.call(req).await; + } } From fa413fcc5335cedd51ede61102240e167d9c9a59 Mon Sep 17 00:00:00 2001 From: tottoto Date: Thu, 24 Apr 2025 07:12:27 +0900 Subject: [PATCH 49/61] feat(server): Add method to get local addr to TcpIncoming (#2233) --- tonic/src/transport/server/incoming.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tonic/src/transport/server/incoming.rs b/tonic/src/transport/server/incoming.rs index 3b99a98bc..fb63d7480 100644 --- a/tonic/src/transport/server/incoming.rs +++ b/tonic/src/transport/server/incoming.rs @@ -70,6 +70,11 @@ impl TcpIncoming { let keepalive = keepalive.map(|t| TcpKeepalive::new().with_time(t)); Self { keepalive, ..self } } + + /// Returns the local address that this tcp incoming is bound to. + pub fn local_addr(&self) -> std::io::Result { + self.inner.as_ref().local_addr() + } } impl From for TcpIncoming { From 09a8c073bf7d46018a7e68ccc791a31eaf265838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenc=20Tam=C3=A1s?= Date: Fri, 25 Apr 2025 15:50:48 +0200 Subject: [PATCH 50/61] feat: expose Status as a Response extension (#2145) Co-authored-by: Lucio Franco --- tonic/src/status.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tonic/src/status.rs b/tonic/src/status.rs index fbf696ffd..057e7a542 100644 --- a/tonic/src/status.rs +++ b/tonic/src/status.rs @@ -581,6 +581,7 @@ impl Status { .headers_mut() .insert(http::header::CONTENT_TYPE, GRPC_CONTENT_TYPE); self.add_header(response.headers_mut()).unwrap(); + response.extensions_mut().insert(self); response } From 90a500b80186a11ac17f2d719beddb4eca25389d Mon Sep 17 00:00:00 2001 From: tottoto Date: Tue, 29 Apr 2025 12:43:22 +0900 Subject: [PATCH 51/61] chore(server): Remove unnecessary await service ready (#2258) --- tonic/src/transport/server/mod.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tonic/src/transport/server/mod.rs b/tonic/src/transport/server/mod.rs index fc5c04b7a..ec4a884b8 100644 --- a/tonic/src/transport/server/mod.rs +++ b/tonic/src/transport/server/mod.rs @@ -52,7 +52,7 @@ use hyper::{body::Incoming, service::Service as HyperService}; use pin_project::pin_project; use std::{ fmt, - future::{self, poll_fn, Future}, + future::{self, Future}, marker::PhantomData, net::SocketAddr, pin::{pin, Pin}, @@ -725,10 +725,6 @@ impl Server { trace!("connection accepted"); - poll_fn(|cx| svc.poll_ready(cx)) - .await - .map_err(super::Error::from_source)?; - let req_svc = svc .call(&io) .await From cb6c67ffc1f2c2feaaaaecd2355dbc08085f8cd4 Mon Sep 17 00:00:00 2001 From: tottoto Date: Thu, 1 May 2025 06:04:57 +0900 Subject: [PATCH 52/61] chore: Use symbolic link for license file (#2241) --- tonic-build/LICENSE | 20 +------------------- tonic-health/LICENSE | 20 +------------------- tonic-reflection/LICENSE | 20 +------------------- tonic-types/LICENSE | 20 +------------------- tonic-web/LICENSE | 20 +------------------- tonic/LICENSE | 20 +------------------- 6 files changed, 6 insertions(+), 114 deletions(-) mode change 100644 => 120000 tonic-build/LICENSE mode change 100644 => 120000 tonic-health/LICENSE mode change 100644 => 120000 tonic-reflection/LICENSE mode change 100644 => 120000 tonic-types/LICENSE mode change 100644 => 120000 tonic-web/LICENSE mode change 100644 => 120000 tonic/LICENSE diff --git a/tonic-build/LICENSE b/tonic-build/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tonic-build/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tonic-build/LICENSE b/tonic-build/LICENSE new file mode 120000 index 000000000..ea5b60640 --- /dev/null +++ b/tonic-build/LICENSE @@ -0,0 +1 @@ +../LICENSE \ No newline at end of file diff --git a/tonic-health/LICENSE b/tonic-health/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tonic-health/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tonic-health/LICENSE b/tonic-health/LICENSE new file mode 120000 index 000000000..ea5b60640 --- /dev/null +++ b/tonic-health/LICENSE @@ -0,0 +1 @@ +../LICENSE \ No newline at end of file diff --git a/tonic-reflection/LICENSE b/tonic-reflection/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tonic-reflection/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tonic-reflection/LICENSE b/tonic-reflection/LICENSE new file mode 120000 index 000000000..ea5b60640 --- /dev/null +++ b/tonic-reflection/LICENSE @@ -0,0 +1 @@ +../LICENSE \ No newline at end of file diff --git a/tonic-types/LICENSE b/tonic-types/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tonic-types/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tonic-types/LICENSE b/tonic-types/LICENSE new file mode 120000 index 000000000..ea5b60640 --- /dev/null +++ b/tonic-types/LICENSE @@ -0,0 +1 @@ +../LICENSE \ No newline at end of file diff --git a/tonic-web/LICENSE b/tonic-web/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tonic-web/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tonic-web/LICENSE b/tonic-web/LICENSE new file mode 120000 index 000000000..ea5b60640 --- /dev/null +++ b/tonic-web/LICENSE @@ -0,0 +1 @@ +../LICENSE \ No newline at end of file diff --git a/tonic/LICENSE b/tonic/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tonic/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tonic/LICENSE b/tonic/LICENSE new file mode 120000 index 000000000..ea5b60640 --- /dev/null +++ b/tonic/LICENSE @@ -0,0 +1 @@ +../LICENSE \ No newline at end of file From 97001f34fe0fe54f53c4ecb9566bc48d40b038b0 Mon Sep 17 00:00:00 2001 From: tottoto Date: Thu, 1 May 2025 23:24:37 +0900 Subject: [PATCH 53/61] chore: Use inline format argument (#2260) --- Cargo.toml | 3 +++ examples/src/authentication/client.rs | 2 +- examples/src/autoreload/server.rs | 2 +- examples/src/blocking/client.rs | 2 +- examples/src/cancellation/client.rs | 2 +- examples/src/cancellation/server.rs | 4 ++-- examples/src/codec_buffers/client.rs | 2 +- examples/src/codec_buffers/server.rs | 2 +- examples/src/compression/server.rs | 2 +- examples/src/dynamic/server.rs | 2 +- examples/src/dynamic_load_balance/client.rs | 14 +++++++------- examples/src/dynamic_load_balance/server.rs | 2 +- examples/src/gcp/client.rs | 6 +++--- examples/src/grpc-web/client.rs | 2 +- examples/src/grpc-web/server.rs | 2 +- examples/src/h2c/client.rs | 2 +- examples/src/h2c/server.rs | 4 ++-- examples/src/health/server.rs | 2 +- examples/src/helloworld/client.rs | 2 +- examples/src/helloworld/server.rs | 2 +- examples/src/interceptor/client.rs | 4 ++-- examples/src/interceptor/server.rs | 4 ++-- examples/src/json-codec/client.rs | 2 +- examples/src/json-codec/server.rs | 2 +- examples/src/load_balance/client.rs | 2 +- examples/src/load_balance/server.rs | 2 +- examples/src/mock/mock.rs | 2 +- examples/src/multiplex/client.rs | 4 ++-- examples/src/richer-error/client.rs | 8 ++++---- examples/src/richer-error/client_vec.rs | 8 ++++---- examples/src/richer-error/server.rs | 4 ++-- examples/src/richer-error/server_vec.rs | 4 ++-- examples/src/routeguide/client.rs | 10 +++++----- examples/src/routeguide/server.rs | 6 +++--- examples/src/streaming/client.rs | 2 +- examples/src/tls/client.rs | 2 +- examples/src/tls_client_auth/client.rs | 2 +- examples/src/tls_rustls/client.rs | 2 +- examples/src/tls_rustls/server.rs | 2 +- examples/src/tower/client.rs | 4 ++-- examples/src/tower/server.rs | 2 +- examples/src/uds/client_standard.rs | 2 +- examples/src/uds/client_with_connector.rs | 2 +- examples/src/uds/server.rs | 2 +- interop/build.rs | 2 +- interop/src/bin/client.rs | 6 +++--- tests/compression/src/bidirectional_stream.rs | 2 +- tests/compression/src/client_stream.rs | 9 +++------ tests/compression/src/compressing_request.rs | 7 ++----- tests/compression/src/compressing_response.rs | 10 +++++----- tests/compression/src/server_stream.rs | 2 +- tests/default_stubs/src/test_defaults.rs | 6 +++--- tests/integration_tests/tests/interceptor.rs | 2 +- .../tests/max_message_size.rs | 7 ++----- tests/integration_tests/tests/timeout.rs | 6 +++--- tests/web/build.rs | 2 +- tests/web/tests/grpc_web.rs | 6 +++--- tonic-build/src/lib.rs | 4 ++-- tonic-build/src/prost.rs | 2 +- tonic-reflection/src/server/mod.rs | 11 +++++------ tonic-types/src/richer_error/mod.rs | 18 ++++++------------ .../richer_error/std_messages/bad_request.rs | 10 +++++----- .../richer_error/std_messages/debug_info.rs | 8 ++++---- .../richer_error/std_messages/error_info.rs | 8 ++++---- .../src/richer_error/std_messages/help.rs | 10 +++++----- .../richer_error/std_messages/loc_message.rs | 8 ++++---- .../richer_error/std_messages/prec_failure.rs | 10 +++++----- .../richer_error/std_messages/quota_failure.rs | 10 +++++----- .../richer_error/std_messages/request_info.rs | 8 ++++---- .../richer_error/std_messages/resource_info.rs | 8 ++++---- .../richer_error/std_messages/retry_info.rs | 8 ++++---- tonic-web/src/call.rs | 9 ++++----- tonic-web/src/service.rs | 5 ++--- tonic/src/codec/decode.rs | 15 ++++++--------- tonic/src/codec/encode.rs | 9 ++++----- tonic/src/metadata/encoding.rs | 6 +++--- tonic/src/metadata/value.rs | 4 ++-- tonic/src/request.rs | 2 +- tonic/src/status.rs | 4 ++-- .../transport/channel/service/user_agent.rs | 8 ++++---- 80 files changed, 189 insertions(+), 208 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 351e1824f..ce9bc4d43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,5 +41,8 @@ missing_docs = "warn" rust_2018_idioms = "warn" unreachable_pub = "warn" +[workspace.lints.clippy] +uninlined_format_args = "deny" + [workspace.lints.rustdoc] broken_intra_doc_links = "deny" diff --git a/examples/src/authentication/client.rs b/examples/src/authentication/client.rs index 2f0a17cad..8c0b8100b 100644 --- a/examples/src/authentication/client.rs +++ b/examples/src/authentication/client.rs @@ -22,7 +22,7 @@ async fn main() -> Result<(), Box> { let response = client.unary_echo(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/autoreload/server.rs b/examples/src/autoreload/server.rs index a181f75ec..f8794314f 100644 --- a/examples/src/autoreload/server.rs +++ b/examples/src/autoreload/server.rs @@ -30,7 +30,7 @@ async fn main() -> Result<(), Box> { let addr = "[::1]:50051".parse().unwrap(); let greeter = MyGreeter::default(); - println!("GreeterServer listening on {}", addr); + println!("GreeterServer listening on {addr}"); let server = Server::builder().add_service(GreeterServer::new(greeter)); diff --git a/examples/src/blocking/client.rs b/examples/src/blocking/client.rs index 3feb73985..5f512a64a 100644 --- a/examples/src/blocking/client.rs +++ b/examples/src/blocking/client.rs @@ -47,7 +47,7 @@ fn main() -> Result<()> { let response = client.say_hello(request)?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/cancellation/client.rs b/examples/src/cancellation/client.rs index 7e9a92772..49ad3d195 100644 --- a/examples/src/cancellation/client.rs +++ b/examples/src/cancellation/client.rs @@ -24,7 +24,7 @@ async fn main() -> Result<(), Box> { } }; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/cancellation/server.rs b/examples/src/cancellation/server.rs index 32d93e7d7..18f92ef2d 100644 --- a/examples/src/cancellation/server.rs +++ b/examples/src/cancellation/server.rs @@ -37,7 +37,7 @@ impl Greeter for MyGreeter { Ok(Response::new(reply)) }; let cancellation_future = async move { - println!("Request from {:?} cancelled by client", remote_addr); + println!("Request from {remote_addr:?} cancelled by client"); // If this future is executed it means the request future was dropped, // so it doesn't actually matter what is returned here Err(Status::cancelled("Request cancelled by client")) @@ -74,7 +74,7 @@ async fn main() -> Result<(), Box> { let addr = "[::1]:50051".parse().unwrap(); let greeter = MyGreeter::default(); - println!("GreeterServer listening on {}", addr); + println!("GreeterServer listening on {addr}"); Server::builder() .add_service(GreeterServer::new(greeter)) diff --git a/examples/src/codec_buffers/client.rs b/examples/src/codec_buffers/client.rs index 267e19dbf..9f912c2b0 100644 --- a/examples/src/codec_buffers/client.rs +++ b/examples/src/codec_buffers/client.rs @@ -24,7 +24,7 @@ async fn main() -> Result<(), Box> { let response = client.say_hello(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/codec_buffers/server.rs b/examples/src/codec_buffers/server.rs index b30c797d3..433fa0cf7 100644 --- a/examples/src/codec_buffers/server.rs +++ b/examples/src/codec_buffers/server.rs @@ -40,7 +40,7 @@ async fn main() -> Result<(), Box> { let addr = "[::1]:50051".parse().unwrap(); let greeter = MyGreeter::default(); - println!("GreeterServer listening on {}", addr); + println!("GreeterServer listening on {addr}"); Server::builder() .add_service(GreeterServer::new(greeter)) diff --git a/examples/src/compression/server.rs b/examples/src/compression/server.rs index fd035d218..f106c3d74 100644 --- a/examples/src/compression/server.rs +++ b/examples/src/compression/server.rs @@ -31,7 +31,7 @@ async fn main() -> Result<(), Box> { let addr = "[::1]:50051".parse().unwrap(); let greeter = MyGreeter::default(); - println!("GreeterServer listening on {}", addr); + println!("GreeterServer listening on {addr}"); let service = GreeterServer::new(greeter) .send_compressed(CompressionEncoding::Gzip) diff --git a/examples/src/dynamic/server.rs b/examples/src/dynamic/server.rs index 14e0bee3e..1e31f18f3 100644 --- a/examples/src/dynamic/server.rs +++ b/examples/src/dynamic/server.rs @@ -77,7 +77,7 @@ async fn main() -> Result<(), Box> { let addr = "[::1]:50051".parse().unwrap(); - println!("Grpc server listening on {}", addr); + println!("Grpc server listening on {addr}"); Server::builder() .add_routes(routes_builder.routes()) diff --git a/examples/src/dynamic_load_balance/client.rs b/examples/src/dynamic_load_balance/client.rs index 1f7ad0949..17f180d3a 100644 --- a/examples/src/dynamic_load_balance/client.rs +++ b/examples/src/dynamic_load_balance/client.rs @@ -27,36 +27,36 @@ async fn main() -> Result<(), Box> { println!("Added first endpoint"); let change = Change::Insert("1", e1); let res = rx.send(change).await; - println!("{:?}", res); + println!("{res:?}"); tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; println!("Added second endpoint"); let change = Change::Insert("2", e2); let res = rx.send(change).await; - println!("{:?}", res); + println!("{res:?}"); tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; println!("Removed first endpoint"); let change = Change::Remove("1"); let res = rx.send(change).await; - println!("{:?}", res); + println!("{res:?}"); tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; println!("Removed second endpoint"); let change = Change::Remove("2"); let res = rx.send(change).await; - println!("{:?}", res); + println!("{res:?}"); tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; println!("Added third endpoint"); let e3 = Endpoint::from_static("http://[::1]:50051"); let change = Change::Insert("3", e3); let res = rx.send(change).await; - println!("{:?}", res); + println!("{res:?}"); tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; println!("Removed third endpoint"); let change = Change::Remove("3"); let res = rx.send(change).await; - println!("{:?}", res); + println!("{res:?}"); demo_done.swap(true, SeqCst); }); @@ -68,7 +68,7 @@ async fn main() -> Result<(), Box> { let rx = client.unary_echo(request); if let Ok(resp) = timeout(tokio::time::Duration::from_secs(10), rx).await { - println!("RESPONSE={:?}", resp); + println!("RESPONSE={resp:?}"); } else { println!("did not receive value within 10 secs"); } diff --git a/examples/src/dynamic_load_balance/server.rs b/examples/src/dynamic_load_balance/server.rs index 7935e1cf5..1143ca57f 100644 --- a/examples/src/dynamic_load_balance/server.rs +++ b/examples/src/dynamic_load_balance/server.rs @@ -41,7 +41,7 @@ async fn main() -> Result<(), Box> { tokio::spawn(async move { if let Err(e) = serve.await { - eprintln!("Error = {:?}", e); + eprintln!("Error = {e:?}"); } tx.send(()).unwrap(); diff --git a/examples/src/gcp/client.rs b/examples/src/gcp/client.rs index 7f30db592..3d66f8695 100644 --- a/examples/src/gcp/client.rs +++ b/examples/src/gcp/client.rs @@ -21,7 +21,7 @@ async fn main() -> Result<(), Box> { .nth(1) .ok_or_else(|| "Expected a project name as the first argument.".to_string())?; - let bearer_token = format!("Bearer {}", token); + let bearer_token = format!("Bearer {token}"); let header_value: MetadataValue<_> = bearer_token.parse()?; let data_dir = std::path::PathBuf::from_iter([std::env!("CARGO_MANIFEST_DIR"), "data"]); @@ -44,13 +44,13 @@ async fn main() -> Result<(), Box> { let response = service .list_topics(Request::new(ListTopicsRequest { - project: format!("projects/{0}", project), + project: format!("projects/{project}"), page_size: 10, ..Default::default() })) .await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/grpc-web/client.rs b/examples/src/grpc-web/client.rs index fa64dd506..3d14c9665 100644 --- a/examples/src/grpc-web/client.rs +++ b/examples/src/grpc-web/client.rs @@ -23,7 +23,7 @@ async fn main() -> Result<(), Box> { let response = client.say_hello(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/grpc-web/server.rs b/examples/src/grpc-web/server.rs index 9fb1a188d..0da7d0f7a 100644 --- a/examples/src/grpc-web/server.rs +++ b/examples/src/grpc-web/server.rs @@ -38,7 +38,7 @@ async fn main() -> Result<(), Box> { .into_inner() .named_layer(GreeterServer::new(greeter)); - println!("GreeterServer listening on {}", addr); + println!("GreeterServer listening on {addr}"); Server::builder() // GrpcWeb is over http1 so we must enable it. diff --git a/examples/src/h2c/client.rs b/examples/src/h2c/client.rs index 240a874cb..5ecac52ea 100644 --- a/examples/src/h2c/client.rs +++ b/examples/src/h2c/client.rs @@ -23,7 +23,7 @@ async fn main() -> Result<(), Box> { let response = client.say_hello(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/h2c/server.rs b/examples/src/h2c/server.rs index 866068a27..3fb97797a 100644 --- a/examples/src/h2c/server.rs +++ b/examples/src/h2c/server.rs @@ -36,7 +36,7 @@ async fn main() -> Result<(), Box> { let addr: SocketAddr = "[::1]:50051".parse().unwrap(); let greeter = MyGreeter::default(); - println!("GreeterServer listening on {}", addr); + println!("GreeterServer listening on {addr}"); let incoming = TcpListener::bind(addr).await?; let svc = Routes::new(GreeterServer::new(greeter)).prepare(); @@ -57,7 +57,7 @@ async fn main() -> Result<(), Box> { }); } Err(e) => { - eprintln!("Error accepting connection: {}", e); + eprintln!("Error accepting connection: {e}"); } } } diff --git a/examples/src/health/server.rs b/examples/src/health/server.rs index 4ae198d51..bd425740a 100644 --- a/examples/src/health/server.rs +++ b/examples/src/health/server.rs @@ -55,7 +55,7 @@ async fn main() -> Result<(), Box> { let addr = "[::1]:50051".parse().unwrap(); let greeter = MyGreeter::default(); - println!("HealthServer + GreeterServer listening on {}", addr); + println!("HealthServer + GreeterServer listening on {addr}"); Server::builder() .add_service(health_service) diff --git a/examples/src/helloworld/client.rs b/examples/src/helloworld/client.rs index 6e6678308..8a443b105 100644 --- a/examples/src/helloworld/client.rs +++ b/examples/src/helloworld/client.rs @@ -15,7 +15,7 @@ async fn main() -> Result<(), Box> { let response = client.say_hello(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/helloworld/server.rs b/examples/src/helloworld/server.rs index c6398bb61..95b74168a 100644 --- a/examples/src/helloworld/server.rs +++ b/examples/src/helloworld/server.rs @@ -30,7 +30,7 @@ async fn main() -> Result<(), Box> { let addr = "[::1]:50051".parse().unwrap(); let greeter = MyGreeter::default(); - println!("GreeterServer listening on {}", addr); + println!("GreeterServer listening on {addr}"); Server::builder() .add_service(GreeterServer::new(greeter)) diff --git a/examples/src/interceptor/client.rs b/examples/src/interceptor/client.rs index 6ef183b12..bac4a6acb 100644 --- a/examples/src/interceptor/client.rs +++ b/examples/src/interceptor/client.rs @@ -25,7 +25,7 @@ async fn main() -> Result<(), Box> { let response = client.say_hello(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } @@ -34,7 +34,7 @@ async fn main() -> Result<(), Box> { /// `Status` here will cancel the request and have that status returned to /// the caller. fn intercept(req: Request<()>) -> Result, Status> { - println!("Intercepting request: {:?}", req); + println!("Intercepting request: {req:?}"); Ok(req) } diff --git a/examples/src/interceptor/server.rs b/examples/src/interceptor/server.rs index fd0cf462f..0061442ef 100644 --- a/examples/src/interceptor/server.rs +++ b/examples/src/interceptor/server.rs @@ -36,7 +36,7 @@ async fn main() -> Result<(), Box> { // structs. let svc = GreeterServer::with_interceptor(greeter, intercept); - println!("GreeterServer listening on {}", addr); + println!("GreeterServer listening on {addr}"); Server::builder().add_service(svc).serve(addr).await?; @@ -47,7 +47,7 @@ async fn main() -> Result<(), Box> { /// is returned, it will cancel the request and return that status to the /// client. fn intercept(mut req: Request<()>) -> Result, Status> { - println!("Intercepting request: {:?}", req); + println!("Intercepting request: {req:?}"); // Set an extension that can be retrieved by `say_hello` req.extensions_mut().insert(MyExtension { diff --git a/examples/src/json-codec/client.rs b/examples/src/json-codec/client.rs index dd6305ef6..f5363ea3f 100644 --- a/examples/src/json-codec/client.rs +++ b/examples/src/json-codec/client.rs @@ -22,7 +22,7 @@ async fn main() -> Result<(), Box> { let response = client.say_hello(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/json-codec/server.rs b/examples/src/json-codec/server.rs index 1029b0bf9..319949091 100644 --- a/examples/src/json-codec/server.rs +++ b/examples/src/json-codec/server.rs @@ -37,7 +37,7 @@ async fn main() -> Result<(), Box> { let addr = "[::1]:50051".parse().unwrap(); let greeter = MyGreeter::default(); - println!("GreeterServer listening on {}", addr); + println!("GreeterServer listening on {addr}"); Server::builder() .add_service(GreeterServer::new(greeter)) diff --git a/examples/src/load_balance/client.rs b/examples/src/load_balance/client.rs index 8bb28061b..d4f21a659 100644 --- a/examples/src/load_balance/client.rs +++ b/examples/src/load_balance/client.rs @@ -22,7 +22,7 @@ async fn main() -> Result<(), Box> { let response = client.unary_echo(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); } Ok(()) diff --git a/examples/src/load_balance/server.rs b/examples/src/load_balance/server.rs index 7935e1cf5..1143ca57f 100644 --- a/examples/src/load_balance/server.rs +++ b/examples/src/load_balance/server.rs @@ -41,7 +41,7 @@ async fn main() -> Result<(), Box> { tokio::spawn(async move { if let Err(e) = serve.await { - eprintln!("Error = {:?}", e); + eprintln!("Error = {e:?}"); } tx.send(()).unwrap(); diff --git a/examples/src/mock/mock.rs b/examples/src/mock/mock.rs index fd6be0482..ae943a419 100644 --- a/examples/src/mock/mock.rs +++ b/examples/src/mock/mock.rs @@ -53,7 +53,7 @@ async fn main() -> Result<(), Box> { let response = client.say_hello(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/multiplex/client.rs b/examples/src/multiplex/client.rs index c6b25cad3..c598afe2a 100644 --- a/examples/src/multiplex/client.rs +++ b/examples/src/multiplex/client.rs @@ -25,7 +25,7 @@ async fn main() -> Result<(), Box> { let response = greeter_client.say_hello(request).await?; - println!("GREETER RESPONSE={:?}", response); + println!("GREETER RESPONSE={response:?}"); let request = tonic::Request::new(EchoRequest { message: "hello".into(), @@ -33,7 +33,7 @@ async fn main() -> Result<(), Box> { let response = echo_client.unary_echo(request).await?; - println!("ECHO RESPONSE={:?}", response); + println!("ECHO RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/richer-error/client.rs b/examples/src/richer-error/client.rs index 3ccf35428..25167a7b0 100644 --- a/examples/src/richer-error/client.rs +++ b/examples/src/richer-error/client.rs @@ -29,15 +29,15 @@ async fn main() -> Result<(), Box> { if let Some(bad_request) = err_details.bad_request() { // Handle bad_request details - println!(" {:?}", bad_request); + println!(" {bad_request:?}"); } if let Some(help) = err_details.help() { // Handle help details - println!(" {:?}", help); + println!(" {help:?}"); } if let Some(localized_message) = err_details.localized_message() { // Handle localized_message details - println!(" {:?}", localized_message); + println!(" {localized_message:?}"); } println!(); @@ -46,7 +46,7 @@ async fn main() -> Result<(), Box> { } }; - println!(" Successful response received.\n\n {:?}\n", response); + println!(" Successful response received.\n\n {response:?}\n"); Ok(()) } diff --git a/examples/src/richer-error/client_vec.rs b/examples/src/richer-error/client_vec.rs index c852c61a4..973bef008 100644 --- a/examples/src/richer-error/client_vec.rs +++ b/examples/src/richer-error/client_vec.rs @@ -32,15 +32,15 @@ async fn main() -> Result<(), Box> { match err_detail { ErrorDetail::BadRequest(bad_request) => { // Handle bad_request details - println!(" {:?}", bad_request); + println!(" {bad_request:?}"); } ErrorDetail::Help(help) => { // Handle help details - println!(" {:?}", help); + println!(" {help:?}"); } ErrorDetail::LocalizedMessage(localized_message) => { // Handle localized_message details - println!(" {:?}", localized_message); + println!(" {localized_message:?}"); } _ => {} } @@ -52,7 +52,7 @@ async fn main() -> Result<(), Box> { } }; - println!(" Successful response received.\n\n {:?}\n", response); + println!(" Successful response received.\n\n {response:?}\n"); Ok(()) } diff --git a/examples/src/richer-error/server.rs b/examples/src/richer-error/server.rs index 235f8c157..9d390c0ae 100644 --- a/examples/src/richer-error/server.rs +++ b/examples/src/richer-error/server.rs @@ -49,7 +49,7 @@ impl Greeter for MyGreeter { } let reply = hello_world::HelloReply { - message: format!("Hello {}!", name), + message: format!("Hello {name}!"), }; Ok(Response::new(reply)) } @@ -60,7 +60,7 @@ async fn main() -> Result<(), Box> { let addr = "[::1]:50051".parse().unwrap(); let greeter = MyGreeter::default(); - println!("GreeterServer listening on {}", addr); + println!("GreeterServer listening on {addr}"); Server::builder() .add_service(GreeterServer::new(greeter)) diff --git a/examples/src/richer-error/server_vec.rs b/examples/src/richer-error/server_vec.rs index 80093e55f..f988a117f 100644 --- a/examples/src/richer-error/server_vec.rs +++ b/examples/src/richer-error/server_vec.rs @@ -49,7 +49,7 @@ impl Greeter for MyGreeter { } let reply = hello_world::HelloReply { - message: format!("Hello {}!", name), + message: format!("Hello {name}!"), }; Ok(Response::new(reply)) } @@ -60,7 +60,7 @@ async fn main() -> Result<(), Box> { let addr = "[::1]:50051".parse().unwrap(); let greeter = MyGreeter::default(); - println!("GreeterServer listening on {}", addr); + println!("GreeterServer listening on {addr}"); Server::builder() .add_service(GreeterServer::new(greeter)) diff --git a/examples/src/routeguide/client.rs b/examples/src/routeguide/client.rs index 9de1477e6..231805d00 100644 --- a/examples/src/routeguide/client.rs +++ b/examples/src/routeguide/client.rs @@ -32,7 +32,7 @@ async fn print_features(client: &mut RouteGuideClient) -> Result<(), Bo .into_inner(); while let Some(feature) = stream.message().await? { - println!("FEATURE = {:?}", feature); + println!("FEATURE = {feature:?}"); } Ok(()) @@ -52,7 +52,7 @@ async fn run_record_route(client: &mut RouteGuideClient) -> Result<(), match client.record_route(request).await { Ok(response) => println!("SUMMARY: {:?}", response.into_inner()), - Err(e) => println!("something went wrong: {:?}", e), + Err(e) => println!("something went wrong: {e:?}"), } Ok(()) @@ -72,7 +72,7 @@ async fn run_route_chat(client: &mut RouteGuideClient) -> Result<(), Bo latitude: 409146138 + elapsed.as_secs() as i32, longitude: -746188906, }), - message: format!("at {:?}", elapsed), + message: format!("at {elapsed:?}"), }; yield note; @@ -83,7 +83,7 @@ async fn run_route_chat(client: &mut RouteGuideClient) -> Result<(), Bo let mut inbound = response.into_inner(); while let Some(note) = inbound.message().await? { - println!("NOTE = {:?}", note); + println!("NOTE = {note:?}"); } Ok(()) @@ -100,7 +100,7 @@ async fn main() -> Result<(), Box> { longitude: -746_188_906, })) .await?; - println!("RESPONSE = {:?}", response); + println!("RESPONSE = {response:?}"); println!("\n*** SERVER STREAMING ***"); print_features(&mut client).await?; diff --git a/examples/src/routeguide/server.rs b/examples/src/routeguide/server.rs index 93d456746..2f3538e95 100644 --- a/examples/src/routeguide/server.rs +++ b/examples/src/routeguide/server.rs @@ -50,7 +50,7 @@ impl RouteGuide for RouteGuideService { tokio::spawn(async move { for feature in &features[..] { if in_range(feature.location.as_ref().unwrap(), request.get_ref()) { - println!(" => send {:?}", feature); + println!(" => send {feature:?}"); tx.send(Ok(feature.clone())).await.unwrap(); } } @@ -76,7 +76,7 @@ impl RouteGuide for RouteGuideService { while let Some(point) = stream.next().await { let point = point?; - println!(" ==> Point = {:?}", point); + println!(" ==> Point = {point:?}"); // Increment the point count summary.point_count += 1; @@ -135,7 +135,7 @@ impl RouteGuide for RouteGuideService { async fn main() -> Result<(), Box> { let addr = "[::1]:10000".parse().unwrap(); - println!("RouteGuideServer listening on: {}", addr); + println!("RouteGuideServer listening on: {addr}"); let route_guide = RouteGuideService { features: Arc::new(data::load()), diff --git a/examples/src/streaming/client.rs b/examples/src/streaming/client.rs index 546f244ff..a7568fca0 100644 --- a/examples/src/streaming/client.rs +++ b/examples/src/streaming/client.rs @@ -10,7 +10,7 @@ use pb::{echo_client::EchoClient, EchoRequest}; fn echo_requests_iter() -> impl Stream { tokio_stream::iter(1..usize::MAX).map(|i| EchoRequest { - message: format!("msg {:02}", i), + message: format!("msg {i:02}"), }) } diff --git a/examples/src/tls/client.rs b/examples/src/tls/client.rs index 8c98547f2..598b34a17 100644 --- a/examples/src/tls/client.rs +++ b/examples/src/tls/client.rs @@ -27,7 +27,7 @@ async fn main() -> Result<(), Box> { let response = client.unary_echo(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/tls_client_auth/client.rs b/examples/src/tls_client_auth/client.rs index 6670c67f5..32275a557 100644 --- a/examples/src/tls_client_auth/client.rs +++ b/examples/src/tls_client_auth/client.rs @@ -32,7 +32,7 @@ async fn main() -> Result<(), Box> { let response = client.unary_echo(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/tls_rustls/client.rs b/examples/src/tls_rustls/client.rs index 6aaa094ac..3db72ef9e 100644 --- a/examples/src/tls_rustls/client.rs +++ b/examples/src/tls_rustls/client.rs @@ -63,7 +63,7 @@ async fn main() -> Result<(), Box> { let response = client.unary_echo(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/tls_rustls/server.rs b/examples/src/tls_rustls/server.rs index 62045da02..26fe818dd 100644 --- a/examples/src/tls_rustls/server.rs +++ b/examples/src/tls_rustls/server.rs @@ -53,7 +53,7 @@ async fn main() -> Result<(), Box> { let (conn, addr) = match listener.accept().await { Ok(incoming) => incoming, Err(e) => { - eprintln!("Error accepting connection: {}", e); + eprintln!("Error accepting connection: {e}"); continue; } }; diff --git a/examples/src/tower/client.rs b/examples/src/tower/client.rs index 86a539aa6..dadaeedf3 100644 --- a/examples/src/tower/client.rs +++ b/examples/src/tower/client.rs @@ -27,14 +27,14 @@ async fn main() -> Result<(), Box> { let response = client.say_hello(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } // An interceptor function. fn intercept(req: Request<()>) -> Result, Status> { - println!("received {:?}", req); + println!("received {req:?}"); Ok(req) } diff --git a/examples/src/tower/server.rs b/examples/src/tower/server.rs index 591e17671..9c891c502 100644 --- a/examples/src/tower/server.rs +++ b/examples/src/tower/server.rs @@ -35,7 +35,7 @@ async fn main() -> Result<(), Box> { let addr = "[::1]:50051".parse().unwrap(); let greeter = MyGreeter::default(); - println!("GreeterServer listening on {}", addr); + println!("GreeterServer listening on {addr}"); let svc = GreeterServer::new(greeter); diff --git a/examples/src/uds/client_standard.rs b/examples/src/uds/client_standard.rs index 264d41cfc..524d14940 100644 --- a/examples/src/uds/client_standard.rs +++ b/examples/src/uds/client_standard.rs @@ -23,7 +23,7 @@ async fn main() -> Result<(), Box> { let response = client.say_hello(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/uds/client_with_connector.rs b/examples/src/uds/client_with_connector.rs index 9a09e6981..34f1282c7 100644 --- a/examples/src/uds/client_with_connector.rs +++ b/examples/src/uds/client_with_connector.rs @@ -35,7 +35,7 @@ async fn main() -> Result<(), Box> { let response = client.say_hello(request).await?; - println!("RESPONSE={:?}", response); + println!("RESPONSE={response:?}"); Ok(()) } diff --git a/examples/src/uds/server.rs b/examples/src/uds/server.rs index ccf9c91a8..d481d4104 100644 --- a/examples/src/uds/server.rs +++ b/examples/src/uds/server.rs @@ -30,7 +30,7 @@ impl Greeter for MyGreeter { #[cfg(unix)] { let conn_info = request.extensions().get::().unwrap(); - println!("Got a request {:?} with info {:?}", request, conn_info); + println!("Got a request {request:?} with info {conn_info:?}"); } let reply = hello_world::HelloReply { diff --git a/interop/build.rs b/interop/build.rs index 7783987a9..295d5e2a3 100644 --- a/interop/build.rs +++ b/interop/build.rs @@ -4,5 +4,5 @@ fn main() { tonic_build::compile_protos(proto).unwrap(); // prevent needing to rebuild if files (or deps) haven't changed - println!("cargo:rerun-if-changed={}", proto); + println!("cargo:rerun-if-changed={proto}"); } diff --git a/interop/src/bin/client.rs b/interop/src/bin/client.rs index 851fa0a3e..01c279200 100644 --- a/interop/src/bin/client.rs +++ b/interop/src/bin/client.rs @@ -32,7 +32,7 @@ async fn main() -> Result<(), Box> { let scheme = if matches.use_tls { "https" } else { "http" }; #[allow(unused_mut)] - let mut endpoint = Endpoint::try_from(format!("{}://localhost:10000", scheme))? + let mut endpoint = Endpoint::try_from(format!("{scheme}://localhost:10000"))? .timeout(Duration::from_secs(5)) .concurrency_limit(30); @@ -54,7 +54,7 @@ async fn main() -> Result<(), Box> { let mut failures = Vec::new(); for test_case in test_cases { - println!("{:?}:", test_case); + println!("{test_case:?}:"); let mut test_results = Vec::new(); match test_case { @@ -87,7 +87,7 @@ async fn main() -> Result<(), Box> { } for result in test_results { - println!(" {}", result); + println!(" {result}"); if result.is_failed() { failures.push(result); diff --git a/tests/compression/src/bidirectional_stream.rs b/tests/compression/src/bidirectional_stream.rs index 3d7fe46f5..c30d8796d 100644 --- a/tests/compression/src/bidirectional_stream.rs +++ b/tests/compression/src/bidirectional_stream.rs @@ -89,7 +89,7 @@ async fn client_enabled_server_enabled(encoding: CompressionEncoding) { CompressionEncoding::Gzip => "gzip", CompressionEncoding::Zstd => "zstd", CompressionEncoding::Deflate => "deflate", - _ => panic!("unexpected encoding {:?}", encoding), + _ => panic!("unexpected encoding {encoding:?}"), }; assert_eq!(res.metadata().get("grpc-encoding").unwrap(), expected); diff --git a/tests/compression/src/client_stream.rs b/tests/compression/src/client_stream.rs index fe31aa01c..bb24f3fe0 100644 --- a/tests/compression/src/client_stream.rs +++ b/tests/compression/src/client_stream.rs @@ -161,14 +161,11 @@ async fn client_enabled_server_disabled(encoding: CompressionEncoding) { CompressionEncoding::Gzip => "gzip", CompressionEncoding::Zstd => "zstd", CompressionEncoding::Deflate => "deflate", - _ => panic!("unexpected encoding {:?}", encoding), + _ => panic!("unexpected encoding {encoding:?}"), }; assert_eq!( status.message(), - format!( - "Content is compressed with `{}` which isn't supported", - expected - ) + format!("Content is compressed with `{expected}` which isn't supported") ); } @@ -218,7 +215,7 @@ async fn compressing_response_from_client_stream(encoding: CompressionEncoding) CompressionEncoding::Gzip => "gzip", CompressionEncoding::Zstd => "zstd", CompressionEncoding::Deflate => "deflate", - _ => panic!("unexpected encoding {:?}", encoding), + _ => panic!("unexpected encoding {encoding:?}"), }; assert_eq!(res.metadata().get("grpc-encoding").unwrap(), expected); let bytes_sent = response_bytes_counter.load(SeqCst); diff --git a/tests/compression/src/compressing_request.rs b/tests/compression/src/compressing_request.rs index ed64f4e9a..ff710f038 100644 --- a/tests/compression/src/compressing_request.rs +++ b/tests/compression/src/compressing_request.rs @@ -177,14 +177,11 @@ async fn client_enabled_server_disabled(encoding: CompressionEncoding) { CompressionEncoding::Gzip => "gzip", CompressionEncoding::Zstd => "zstd", CompressionEncoding::Deflate => "deflate", - _ => panic!("unexpected encoding {:?}", encoding), + _ => panic!("unexpected encoding {encoding:?}"), }; assert_eq!( status.message(), - format!( - "Content is compressed with `{}` which isn't supported", - expected - ) + format!("Content is compressed with `{expected}` which isn't supported") ); assert_eq!( diff --git a/tests/compression/src/compressing_response.rs b/tests/compression/src/compressing_response.rs index 28ac95005..85c5a481e 100644 --- a/tests/compression/src/compressing_response.rs +++ b/tests/compression/src/compressing_response.rs @@ -46,7 +46,7 @@ async fn client_enabled_server_enabled(encoding: CompressionEncoding) { .unwrap() .to_str() .unwrap(), - format!("{},identity", expected) + format!("{expected},identity") ); self.service.call(req) } @@ -88,7 +88,7 @@ async fn client_enabled_server_enabled(encoding: CompressionEncoding) { CompressionEncoding::Gzip => "gzip", CompressionEncoding::Zstd => "zstd", CompressionEncoding::Deflate => "deflate", - _ => panic!("unexpected encoding {:?}", encoding), + _ => panic!("unexpected encoding {encoding:?}"), }; for _ in 0..3 { @@ -353,7 +353,7 @@ async fn disabling_compression_on_single_response(encoding: CompressionEncoding) CompressionEncoding::Gzip => "gzip", CompressionEncoding::Zstd => "zstd", CompressionEncoding::Deflate => "deflate", - _ => panic!("unexpected encoding {:?}", encoding), + _ => panic!("unexpected encoding {encoding:?}"), }; assert_eq!(res.metadata().get("grpc-encoding").unwrap(), expected); @@ -411,7 +411,7 @@ async fn disabling_compression_on_response_but_keeping_compression_on_stream( CompressionEncoding::Gzip => "gzip", CompressionEncoding::Zstd => "zstd", CompressionEncoding::Deflate => "deflate", - _ => panic!("unexpected encoding {:?}", encoding), + _ => panic!("unexpected encoding {encoding:?}"), }; assert_eq!(res.metadata().get("grpc-encoding").unwrap(), expected); @@ -482,7 +482,7 @@ async fn disabling_compression_on_response_from_client_stream(encoding: Compress CompressionEncoding::Gzip => "gzip", CompressionEncoding::Zstd => "zstd", CompressionEncoding::Deflate => "deflate", - _ => panic!("unexpected encoding {:?}", encoding), + _ => panic!("unexpected encoding {encoding:?}"), }; assert_eq!(res.metadata().get("grpc-encoding").unwrap(), expected); let bytes_sent = response_bytes_counter.load(SeqCst); diff --git a/tests/compression/src/server_stream.rs b/tests/compression/src/server_stream.rs index 775149ac2..7a6e1dffe 100644 --- a/tests/compression/src/server_stream.rs +++ b/tests/compression/src/server_stream.rs @@ -47,7 +47,7 @@ async fn client_enabled_server_enabled(encoding: CompressionEncoding) { CompressionEncoding::Gzip => "gzip", CompressionEncoding::Zstd => "zstd", CompressionEncoding::Deflate => "deflate", - _ => panic!("unexpected encoding {:?}", encoding), + _ => panic!("unexpected encoding {encoding:?}"), }; assert_eq!(res.metadata().get("grpc-encoding").unwrap(), expected); diff --git a/tests/default_stubs/src/test_defaults.rs b/tests/default_stubs/src/test_defaults.rs index 01d5e358a..b83de4efc 100644 --- a/tests/default_stubs/src/test_defaults.rs +++ b/tests/default_stubs/src/test_defaults.rs @@ -145,16 +145,16 @@ async fn run_services_in_background_uds() -> (String, String) { .collect(); let tmpdir = fs::canonicalize(env::temp_dir()) .unwrap() - .join(format!("tonic_test_{}", suffix)); + .join(format!("tonic_test_{suffix}")); fs::create_dir(&tmpdir).unwrap(); let uds_filepath = tmpdir.join("impl.sock").to_str().unwrap().to_string(); let listener = UnixListener::bind(uds_filepath.as_str()).unwrap(); - let uds_addr = format!("unix://{}", uds_filepath); + let uds_addr = format!("unix://{uds_filepath}"); let uds_default_stubs_filepath = tmpdir.join("stub.sock").to_str().unwrap().to_string(); let listener_default_stubs = UnixListener::bind(uds_default_stubs_filepath.as_str()).unwrap(); - let uds_default_stubs_addr = format!("unix://{}", uds_default_stubs_filepath); + let uds_default_stubs_addr = format!("unix://{uds_default_stubs_filepath}"); tokio::spawn(async move { Server::builder() diff --git a/tests/integration_tests/tests/interceptor.rs b/tests/integration_tests/tests/interceptor.rs index aec9c35fe..0e10129a4 100644 --- a/tests/integration_tests/tests/interceptor.rs +++ b/tests/integration_tests/tests/interceptor.rs @@ -41,7 +41,7 @@ async fn interceptor_retrieves_grpc_method() { .connect_lazy(); fn client_intercept(req: Request<()>) -> Result, Status> { - println!("Intercepting client request: {:?}", req); + println!("Intercepting client request: {req:?}"); let gm = req.extensions().get::().unwrap(); assert_eq!(gm.service(), "test.Test"); diff --git a/tests/integration_tests/tests/max_message_size.rs b/tests/integration_tests/tests/max_message_size.rs index 0de102066..de6c91f90 100644 --- a/tests/integration_tests/tests/max_message_size.rs +++ b/tests/integration_tests/tests/max_message_size.rs @@ -245,14 +245,11 @@ fn assert_test_case(case: TestCase) { (Some(_), Ok(())) => panic!("Expected failure, but got success"), (Some(code), Err(status)) => { if status.code() != code { - panic!( - "Expected failure, got failure but wrong code, got: {:?}", - status - ) + panic!("Expected failure, got failure but wrong code, got: {status:?}") } } - (None, Err(status)) => panic!("Expected success, but got failure, got: {:?}", status), + (None, Err(status)) => panic!("Expected success, but got failure, got: {status:?}"), _ => (), } diff --git a/tests/integration_tests/tests/timeout.rs b/tests/integration_tests/tests/timeout.rs index 450a67d21..6fb1b885b 100644 --- a/tests/integration_tests/tests/timeout.rs +++ b/tests/integration_tests/tests/timeout.rs @@ -7,7 +7,7 @@ use tonic::{transport::Server, Code, Request, Response, Status}; async fn cancelation_on_timeout() { let addr = run_service_in_background(Duration::from_secs(1), Duration::from_secs(100)).await; - let mut client = test_client::TestClient::connect(format!("http://{}", addr)) + let mut client = test_client::TestClient::connect(format!("http://{addr}")) .await .unwrap(); @@ -27,7 +27,7 @@ async fn cancelation_on_timeout() { async fn picks_server_timeout_if_thats_sorter() { let addr = run_service_in_background(Duration::from_secs(1), Duration::from_millis(100)).await; - let mut client = test_client::TestClient::connect(format!("http://{}", addr)) + let mut client = test_client::TestClient::connect(format!("http://{addr}")) .await .unwrap(); @@ -46,7 +46,7 @@ async fn picks_server_timeout_if_thats_sorter() { async fn picks_client_timeout_if_thats_sorter() { let addr = run_service_in_background(Duration::from_secs(1), Duration::from_secs(100)).await; - let mut client = test_client::TestClient::connect(format!("http://{}", addr)) + let mut client = test_client::TestClient::connect(format!("http://{addr}")) .await .unwrap(); diff --git a/tests/web/build.rs b/tests/web/build.rs index 1abe19299..0a7bed094 100644 --- a/tests/web/build.rs +++ b/tests/web/build.rs @@ -7,5 +7,5 @@ fn main() { protos .iter() - .for_each(|file| println!("cargo:rerun-if-changed={}", file)); + .for_each(|file| println!("cargo:rerun-if-changed={file}")); } diff --git a/tests/web/tests/grpc_web.rs b/tests/web/tests/grpc_web.rs index c0c3c3fdd..32e0b4737 100644 --- a/tests/web/tests/grpc_web.rs +++ b/tests/web/tests/grpc_web.rs @@ -120,14 +120,14 @@ fn build_request(base_uri: String, content_type: &str, accept: &str) -> Request< "grpc-web-text" => test_web::util::base64::STANDARD .encode(encode_body()) .into(), - _ => panic!("invalid content type {}", content_type), + _ => panic!("invalid content type {content_type}"), }; Request::builder() .method(Method::POST) - .header(CONTENT_TYPE, format!("application/{}", content_type)) + .header(CONTENT_TYPE, format!("application/{content_type}")) .header(ORIGIN, "http://example.com") - .header(ACCEPT, format!("application/{}", accept)) + .header(ACCEPT, format!("application/{accept}")) .uri(request_uri) .body(Body::new( Full::new(bytes).map_err(|err| Status::internal(err.to_string())), diff --git a/tonic-build/src/lib.rs b/tonic-build/src/lib.rs index 2ba5b08ce..da2d66465 100644 --- a/tonic-build/src/lib.rs +++ b/tonic-build/src/lib.rs @@ -234,7 +234,7 @@ fn generate_attributes<'a>( .filter(|(matcher, _)| match_name(matcher, name)) .flat_map(|(_, attr)| { // attributes cannot be parsed directly, so we pretend they're on a struct - syn::parse_str::(&format!("{}\nstruct fake;", attr)) + syn::parse_str::(&format!("{attr}\nstruct fake;")) .unwrap() .attrs }) @@ -259,7 +259,7 @@ fn generate_doc_comment>(comment: S) -> TokenStream { let comment = comment.as_ref(); let comment = if !comment.starts_with(' ') { - format!(" {}", comment) + format!(" {comment}") } else { comment.to_string() }; diff --git a/tonic-build/src/prost.rs b/tonic-build/src/prost.rs index 6bf3847b2..f89d00cd9 100644 --- a/tonic-build/src/prost.rs +++ b/tonic-build/src/prost.rs @@ -180,7 +180,7 @@ impl crate::Method for TonicBuildMethod { .unwrap() .to_token_stream() } else { - syn::parse_str::(&format!("{}::{}", proto_path, rust_type)) + syn::parse_str::(&format!("{proto_path}::{rust_type}")) .unwrap() .to_token_stream() } diff --git a/tonic-reflection/src/server/mod.rs b/tonic-reflection/src/server/mod.rs index 2ce34eadb..2b1a806a9 100644 --- a/tonic-reflection/src/server/mod.rs +++ b/tonic-reflection/src/server/mod.rs @@ -251,7 +251,7 @@ impl ReflectionServiceState { fn symbol_by_name(&self, symbol: &str) -> Result, Status> { match self.symbols.get(symbol) { - None => Err(Status::not_found(format!("symbol '{}' not found", symbol))), + None => Err(Status::not_found(format!("symbol '{symbol}' not found"))), Some(fd) => { let mut encoded_fd = Vec::new(); if fd.clone().encode(&mut encoded_fd).is_err() { @@ -265,7 +265,7 @@ impl ReflectionServiceState { fn file_by_filename(&self, filename: &str) -> Result, Status> { match self.files.get(filename) { - None => Err(Status::not_found(format!("file '{}' not found", filename))), + None => Err(Status::not_found(format!("file '{filename}' not found"))), Some(fd) => { let mut encoded_fd = Vec::new(); if fd.clone().encode(&mut encoded_fd).is_err() { @@ -285,14 +285,13 @@ fn extract_name( ) -> Result { match maybe_name { None => Err(Error::InvalidFileDescriptorSet(format!( - "missing {} name", - name_type + "missing {name_type} name" ))), Some(name) => { if prefix.is_empty() { Ok(name.to_string()) } else { - Ok(format!("{}.{}", prefix, name)) + Ok(format!("{prefix}.{name}")) } } } @@ -320,7 +319,7 @@ impl Display for Error { match self { Error::DecodeError(_) => f.write_str("error decoding FileDescriptorSet from buffer"), Error::InvalidFileDescriptorSet(s) => { - write!(f, "invalid FileDescriptorSet - {}", s) + write!(f, "invalid FileDescriptorSet - {s}") } } } diff --git a/tonic-types/src/richer_error/mod.rs b/tonic-types/src/richer_error/mod.rs index 927bbc97d..54cd9447c 100644 --- a/tonic-types/src/richer_error/mod.rs +++ b/tonic-types/src/richer_error/mod.rs @@ -1002,7 +1002,7 @@ mod tests { .add_help_link("link to resource", "resource.example.local") .set_localized_message("en-US", "message for the user"); - let fmt_details = format!("{:?}", err_details); + let fmt_details = format!("{err_details:?}"); let err_details_vec = vec![ RetryInfo::new(Some(Duration::from_secs(5))).into(), @@ -1021,7 +1021,7 @@ mod tests { LocalizedMessage::new("en-US", "message for the user").into(), ]; - let fmt_details_vec = format!("{:?}", err_details_vec); + let fmt_details_vec = format!("{err_details_vec:?}"); let status_from_struct = Status::with_error_details( Code::InvalidArgument, @@ -1037,13 +1037,10 @@ mod tests { let ext_details = match status_from_vec.check_error_details() { Ok(ext_details) => ext_details, - Err(err) => panic!( - "Error extracting details struct from status_from_vec: {:?}", - err - ), + Err(err) => panic!("Error extracting details struct from status_from_vec: {err:?}"), }; - let fmt_ext_details = format!("{:?}", ext_details); + let fmt_ext_details = format!("{ext_details:?}"); assert!( fmt_ext_details.eq(&fmt_details), @@ -1052,13 +1049,10 @@ mod tests { let ext_details_vec = match status_from_struct.check_error_details_vec() { Ok(ext_details) => ext_details, - Err(err) => panic!( - "Error extracting details_vec from status_from_struct: {:?}", - err - ), + Err(err) => panic!("Error extracting details_vec from status_from_struct: {err:?}"), }; - let fmt_ext_details_vec = format!("{:?}", ext_details_vec); + let fmt_ext_details_vec = format!("{ext_details_vec:?}"); assert!( fmt_ext_details_vec.eq(&fmt_details_vec), diff --git a/tonic-types/src/richer_error/std_messages/bad_request.rs b/tonic-types/src/richer_error/std_messages/bad_request.rs index c9fcb984a..6445da557 100644 --- a/tonic-types/src/richer_error/std_messages/bad_request.rs +++ b/tonic-types/src/richer_error/std_messages/bad_request.rs @@ -150,7 +150,7 @@ mod tests { #[test] fn gen_bad_request() { let mut br_details = BadRequest::new(Vec::new()); - let formatted = format!("{:?}", br_details); + let formatted = format!("{br_details:?}"); let expected = "BadRequest { field_violations: [] }"; @@ -168,7 +168,7 @@ mod tests { .add_violation("field_a", "description_a") .add_violation("field_b", "description_b"); - let formatted = format!("{:?}", br_details); + let formatted = format!("{br_details:?}"); let expected_filled = "BadRequest { field_violations: [FieldViolation { field: \"field_a\", description: \"description_a\" }, FieldViolation { field: \"field_b\", description: \"description_b\" }] }"; @@ -183,7 +183,7 @@ mod tests { ); let gen_any = br_details.into_any(); - let formatted = format!("{:?}", gen_any); + let formatted = format!("{gen_any:?}"); let expected = "Any { type_url: \"type.googleapis.com/google.rpc.BadRequest\", value: [10, 24, 10, 7, 102, 105, 101, 108, 100, 95, 97, 18, 13, 100, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 95, 97, 10, 24, 10, 7, 102, 105, 101, 108, 100, 95, 98, 18, 13, 100, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 95, 98] }"; @@ -193,11 +193,11 @@ mod tests { ); let br_details = match BadRequest::from_any(gen_any) { - Err(error) => panic!("Error generating BadRequest from Any: {:?}", error), + Err(error) => panic!("Error generating BadRequest from Any: {error:?}"), Ok(from_any) => from_any, }; - let formatted = format!("{:?}", br_details); + let formatted = format!("{br_details:?}"); assert!( formatted.eq(expected_filled), diff --git a/tonic-types/src/richer_error/std_messages/debug_info.rs b/tonic-types/src/richer_error/std_messages/debug_info.rs index 9c450c774..c71954099 100644 --- a/tonic-types/src/richer_error/std_messages/debug_info.rs +++ b/tonic-types/src/richer_error/std_messages/debug_info.rs @@ -94,7 +94,7 @@ mod tests { "details about the error", ); - let formatted = format!("{:?}", debug_info); + let formatted = format!("{debug_info:?}"); let expected_filled = "DebugInfo { stack_entries: [\"trace 3\", \"trace 2\", \"trace 1\"], detail: \"details about the error\" }"; @@ -104,7 +104,7 @@ mod tests { ); let gen_any = debug_info.into_any(); - let formatted = format!("{:?}", gen_any); + let formatted = format!("{gen_any:?}"); let expected = "Any { type_url: \"type.googleapis.com/google.rpc.DebugInfo\", value: [10, 7, 116, 114, 97, 99, 101, 32, 51, 10, 7, 116, 114, 97, 99, 101, 32, 50, 10, 7, 116, 114, 97, 99, 101, 32, 49, 18, 23, 100, 101, 116, 97, 105, 108, 115, 32, 97, 98, 111, 117, 116, 32, 116, 104, 101, 32, 101, 114, 114, 111, 114] }"; @@ -115,11 +115,11 @@ mod tests { ); let br_details = match DebugInfo::from_any(gen_any) { - Err(error) => panic!("Error generating DebugInfo from Any: {:?}", error), + Err(error) => panic!("Error generating DebugInfo from Any: {error:?}"), Ok(from_any) => from_any, }; - let formatted = format!("{:?}", br_details); + let formatted = format!("{br_details:?}"); assert!( formatted.eq(expected_filled), diff --git a/tonic-types/src/richer_error/std_messages/error_info.rs b/tonic-types/src/richer_error/std_messages/error_info.rs index 8d535a157..8b1f36a7e 100644 --- a/tonic-types/src/richer_error/std_messages/error_info.rs +++ b/tonic-types/src/richer_error/std_messages/error_info.rs @@ -114,7 +114,7 @@ mod tests { let error_info = ErrorInfo::new("SOME_INFO", "mydomain.com", metadata); - let formatted = format!("{:?}", error_info); + let formatted = format!("{error_info:?}"); let expected_filled = "ErrorInfo { reason: \"SOME_INFO\", domain: \"mydomain.com\", metadata: {\"instanceLimitPerRequest\": \"100\"} }"; @@ -125,7 +125,7 @@ mod tests { let gen_any = error_info.into_any(); - let formatted = format!("{:?}", gen_any); + let formatted = format!("{gen_any:?}"); let expected = "Any { type_url: \"type.googleapis.com/google.rpc.ErrorInfo\", value: [10, 9, 83, 79, 77, 69, 95, 73, 78, 70, 79, 18, 12, 109, 121, 100, 111, 109, 97, 105, 110, 46, 99, 111, 109, 26, 30, 10, 23, 105, 110, 115, 116, 97, 110, 99, 101, 76, 105, 109, 105, 116, 80, 101, 114, 82, 101, 113, 117, 101, 115, 116, 18, 3, 49, 48, 48] }"; @@ -136,11 +136,11 @@ mod tests { ); let br_details = match ErrorInfo::from_any(gen_any) { - Err(error) => panic!("Error generating ErrorInfo from Any: {:?}", error), + Err(error) => panic!("Error generating ErrorInfo from Any: {error:?}"), Ok(from_any) => from_any, }; - let formatted = format!("{:?}", br_details); + let formatted = format!("{br_details:?}"); assert!( formatted.eq(expected_filled), diff --git a/tonic-types/src/richer_error/std_messages/help.rs b/tonic-types/src/richer_error/std_messages/help.rs index 08549b2e9..67e44a3f8 100644 --- a/tonic-types/src/richer_error/std_messages/help.rs +++ b/tonic-types/src/richer_error/std_messages/help.rs @@ -146,7 +146,7 @@ mod tests { #[test] fn gen_help() { let mut help = Help::new(Vec::new()); - let formatted = format!("{:?}", help); + let formatted = format!("{help:?}"); let expected = "Help { links: [] }"; @@ -163,7 +163,7 @@ mod tests { help.add_link("link to resource a", "resource-a.example.local") .add_link("link to resource b", "resource-b.example.local"); - let formatted = format!("{:?}", help); + let formatted = format!("{help:?}"); let expected_filled = "Help { links: [HelpLink { description: \"link to resource a\", url: \"resource-a.example.local\" }, HelpLink { description: \"link to resource b\", url: \"resource-b.example.local\" }] }"; @@ -179,7 +179,7 @@ mod tests { let gen_any = help.into_any(); - let formatted = format!("{:?}", gen_any); + let formatted = format!("{gen_any:?}"); let expected = "Any { type_url: \"type.googleapis.com/google.rpc.Help\", value: [10, 46, 10, 18, 108, 105, 110, 107, 32, 116, 111, 32, 114, 101, 115, 111, 117, 114, 99, 101, 32, 97, 18, 24, 114, 101, 115, 111, 117, 114, 99, 101, 45, 97, 46, 101, 120, 97, 109, 112, 108, 101, 46, 108, 111, 99, 97, 108, 10, 46, 10, 18, 108, 105, 110, 107, 32, 116, 111, 32, 114, 101, 115, 111, 117, 114, 99, 101, 32, 98, 18, 24, 114, 101, 115, 111, 117, 114, 99, 101, 45, 98, 46, 101, 120, 97, 109, 112, 108, 101, 46, 108, 111, 99, 97, 108] }"; @@ -189,11 +189,11 @@ mod tests { ); let br_details = match Help::from_any(gen_any) { - Err(error) => panic!("Error generating Help from Any: {:?}", error), + Err(error) => panic!("Error generating Help from Any: {error:?}"), Ok(from_any) => from_any, }; - let formatted = format!("{:?}", br_details); + let formatted = format!("{br_details:?}"); assert!( formatted.eq(expected_filled), diff --git a/tonic-types/src/richer_error/std_messages/loc_message.rs b/tonic-types/src/richer_error/std_messages/loc_message.rs index 98ab72bce..7b032d479 100644 --- a/tonic-types/src/richer_error/std_messages/loc_message.rs +++ b/tonic-types/src/richer_error/std_messages/loc_message.rs @@ -95,7 +95,7 @@ mod tests { fn gen_localized_message() { let loc_message = LocalizedMessage::new("en-US", "message for the user"); - let formatted = format!("{:?}", loc_message); + let formatted = format!("{loc_message:?}"); let expected_filled = "LocalizedMessage { locale: \"en-US\", message: \"message for the user\" }"; @@ -107,7 +107,7 @@ mod tests { let gen_any = loc_message.into_any(); - let formatted = format!("{:?}", gen_any); + let formatted = format!("{gen_any:?}"); let expected = "Any { type_url: \"type.googleapis.com/google.rpc.LocalizedMessage\", value: [10, 5, 101, 110, 45, 85, 83, 18, 20, 109, 101, 115, 115, 97, 103, 101, 32, 102, 111, 114, 32, 116, 104, 101, 32, 117, 115, 101, 114] }"; @@ -118,11 +118,11 @@ mod tests { ); let br_details = match LocalizedMessage::from_any(gen_any) { - Err(error) => panic!("Error generating LocalizedMessage from Any: {:?}", error), + Err(error) => panic!("Error generating LocalizedMessage from Any: {error:?}"), Ok(from_any) => from_any, }; - let formatted = format!("{:?}", br_details); + let formatted = format!("{br_details:?}"); assert!( formatted.eq(expected_filled), diff --git a/tonic-types/src/richer_error/std_messages/prec_failure.rs b/tonic-types/src/richer_error/std_messages/prec_failure.rs index a8a5c50f1..9e4f8884b 100644 --- a/tonic-types/src/richer_error/std_messages/prec_failure.rs +++ b/tonic-types/src/richer_error/std_messages/prec_failure.rs @@ -170,7 +170,7 @@ mod tests { #[test] fn gen_prec_failure() { let mut prec_failure = PreconditionFailure::new(Vec::new()); - let formatted = format!("{:?}", prec_failure); + let formatted = format!("{prec_failure:?}"); let expected = "PreconditionFailure { violations: [] }"; @@ -188,7 +188,7 @@ mod tests { .add_violation("TOS", "example.local", "Terms of service not accepted") .add_violation("FNF", "example.local", "File not found"); - let formatted = format!("{:?}", prec_failure); + let formatted = format!("{prec_failure:?}"); let expected_filled = "PreconditionFailure { violations: [PreconditionViolation { type: \"TOS\", subject: \"example.local\", description: \"Terms of service not accepted\" }, PreconditionViolation { type: \"FNF\", subject: \"example.local\", description: \"File not found\" }] }"; @@ -204,7 +204,7 @@ mod tests { let gen_any = prec_failure.into_any(); - let formatted = format!("{:?}", gen_any); + let formatted = format!("{gen_any:?}"); let expected = "Any { type_url: \"type.googleapis.com/google.rpc.PreconditionFailure\", value: [10, 51, 10, 3, 84, 79, 83, 18, 13, 101, 120, 97, 109, 112, 108, 101, 46, 108, 111, 99, 97, 108, 26, 29, 84, 101, 114, 109, 115, 32, 111, 102, 32, 115, 101, 114, 118, 105, 99, 101, 32, 110, 111, 116, 32, 97, 99, 99, 101, 112, 116, 101, 100, 10, 36, 10, 3, 70, 78, 70, 18, 13, 101, 120, 97, 109, 112, 108, 101, 46, 108, 111, 99, 97, 108, 26, 14, 70, 105, 108, 101, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100] }"; @@ -214,11 +214,11 @@ mod tests { ); let br_details = match PreconditionFailure::from_any(gen_any) { - Err(error) => panic!("Error generating PreconditionFailure from Any: {:?}", error), + Err(error) => panic!("Error generating PreconditionFailure from Any: {error:?}"), Ok(from_any) => from_any, }; - let formatted = format!("{:?}", br_details); + let formatted = format!("{br_details:?}"); assert!( formatted.eq(expected_filled), diff --git a/tonic-types/src/richer_error/std_messages/quota_failure.rs b/tonic-types/src/richer_error/std_messages/quota_failure.rs index 23d160521..d4ad35a1e 100644 --- a/tonic-types/src/richer_error/std_messages/quota_failure.rs +++ b/tonic-types/src/richer_error/std_messages/quota_failure.rs @@ -147,7 +147,7 @@ mod tests { #[test] fn gen_quota_failure() { let mut quota_failure = QuotaFailure::new(Vec::new()); - let formatted = format!("{:?}", quota_failure); + let formatted = format!("{quota_failure:?}"); let expected = "QuotaFailure { violations: [] }"; @@ -165,7 +165,7 @@ mod tests { .add_violation("clientip:", "description a") .add_violation("project:", "description b"); - let formatted = format!("{:?}", quota_failure); + let formatted = format!("{quota_failure:?}"); let expected_filled = "QuotaFailure { violations: [QuotaViolation { subject: \"clientip:\", description: \"description a\" }, QuotaViolation { subject: \"project:\", description: \"description b\" }] }"; @@ -181,7 +181,7 @@ mod tests { let gen_any = quota_failure.into_any(); - let formatted = format!("{:?}", gen_any); + let formatted = format!("{gen_any:?}"); let expected = "Any { type_url: \"type.googleapis.com/google.rpc.QuotaFailure\", value: [10, 38, 10, 21, 99, 108, 105, 101, 110, 116, 105, 112, 58, 60, 105, 112, 32, 97, 100, 100, 114, 101, 115, 115, 62, 18, 13, 100, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 32, 97, 10, 37, 10, 20, 112, 114, 111, 106, 101, 99, 116, 58, 60, 112, 114, 111, 106, 101, 99, 116, 32, 105, 100, 62, 18, 13, 100, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 32, 98] }"; @@ -191,11 +191,11 @@ mod tests { ); let br_details = match QuotaFailure::from_any(gen_any) { - Err(error) => panic!("Error generating QuotaFailure from Any: {:?}", error), + Err(error) => panic!("Error generating QuotaFailure from Any: {error:?}"), Ok(from_any) => from_any, }; - let formatted = format!("{:?}", br_details); + let formatted = format!("{br_details:?}"); assert!( formatted.eq(expected_filled), diff --git a/tonic-types/src/richer_error/std_messages/request_info.rs b/tonic-types/src/richer_error/std_messages/request_info.rs index bb09f0c5b..66a84633a 100644 --- a/tonic-types/src/richer_error/std_messages/request_info.rs +++ b/tonic-types/src/richer_error/std_messages/request_info.rs @@ -94,7 +94,7 @@ mod tests { fn gen_request_info() { let req_info = RequestInfo::new("some-id", "some-data"); - let formatted = format!("{:?}", req_info); + let formatted = format!("{req_info:?}"); let expected_filled = "RequestInfo { request_id: \"some-id\", serving_data: \"some-data\" }"; @@ -106,7 +106,7 @@ mod tests { let gen_any = req_info.into_any(); - let formatted = format!("{:?}", gen_any); + let formatted = format!("{gen_any:?}"); let expected = "Any { type_url: \"type.googleapis.com/google.rpc.RequestInfo\", value: [10, 7, 115, 111, 109, 101, 45, 105, 100, 18, 9, 115, 111, 109, 101, 45, 100, 97, 116, 97] }"; @@ -117,11 +117,11 @@ mod tests { ); let br_details = match RequestInfo::from_any(gen_any) { - Err(error) => panic!("Error generating RequestInfo from Any: {:?}", error), + Err(error) => panic!("Error generating RequestInfo from Any: {error:?}"), Ok(from_any) => from_any, }; - let formatted = format!("{:?}", br_details); + let formatted = format!("{br_details:?}"); assert!( formatted.eq(expected_filled), diff --git a/tonic-types/src/richer_error/std_messages/resource_info.rs b/tonic-types/src/richer_error/std_messages/resource_info.rs index ccb23e1a7..15b796442 100644 --- a/tonic-types/src/richer_error/std_messages/resource_info.rs +++ b/tonic-types/src/richer_error/std_messages/resource_info.rs @@ -111,7 +111,7 @@ mod tests { fn gen_resource_info() { let res_info = ResourceInfo::new("resource-type", "resource-name", "owner", "description"); - let formatted = format!("{:?}", res_info); + let formatted = format!("{res_info:?}"); let expected_filled = "ResourceInfo { resource_type: \"resource-type\", resource_name: \"resource-name\", owner: \"owner\", description: \"description\" }"; @@ -122,7 +122,7 @@ mod tests { let gen_any = res_info.into_any(); - let formatted = format!("{:?}", gen_any); + let formatted = format!("{gen_any:?}"); let expected = "Any { type_url: \"type.googleapis.com/google.rpc.ResourceInfo\", value: [10, 13, 114, 101, 115, 111, 117, 114, 99, 101, 45, 116, 121, 112, 101, 18, 13, 114, 101, 115, 111, 117, 114, 99, 101, 45, 110, 97, 109, 101, 26, 5, 111, 119, 110, 101, 114, 34, 11, 100, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110] }"; @@ -133,11 +133,11 @@ mod tests { ); let br_details = match ResourceInfo::from_any(gen_any) { - Err(error) => panic!("Error generating ResourceInfo from Any: {:?}", error), + Err(error) => panic!("Error generating ResourceInfo from Any: {error:?}"), Ok(from_any) => from_any, }; - let formatted = format!("{:?}", br_details); + let formatted = format!("{br_details:?}"); assert!( formatted.eq(expected_filled), diff --git a/tonic-types/src/richer_error/std_messages/retry_info.rs b/tonic-types/src/richer_error/std_messages/retry_info.rs index 93697afb1..ccb3a2b0f 100644 --- a/tonic-types/src/richer_error/std_messages/retry_info.rs +++ b/tonic-types/src/richer_error/std_messages/retry_info.rs @@ -126,7 +126,7 @@ mod tests { fn gen_retry_info() { let retry_info = RetryInfo::new(Some(Duration::from_secs(u64::MAX))); - let formatted = format!("{:?}", retry_info); + let formatted = format!("{retry_info:?}"); let expected_filled = "RetryInfo { retry_delay: Some(315576000000.999999999s) }"; @@ -142,7 +142,7 @@ mod tests { let gen_any = retry_info.into_any(); - let formatted = format!("{:?}", gen_any); + let formatted = format!("{gen_any:?}"); let expected = "Any { type_url: \"type.googleapis.com/google.rpc.RetryInfo\", value: [10, 13, 8, 128, 188, 174, 206, 151, 9, 16, 255, 147, 235, 220, 3] }"; @@ -153,11 +153,11 @@ mod tests { ); let br_details = match RetryInfo::from_any(gen_any) { - Err(error) => panic!("Error generating RetryInfo from Any: {:?}", error), + Err(error) => panic!("Error generating RetryInfo from Any: {error:?}"), Ok(from_any) => from_any, }; - let formatted = format!("{:?}", br_details); + let formatted = format!("{br_details:?}"); assert!( formatted.eq(expected_filled), diff --git a/tonic-web/src/call.rs b/tonic-web/src/call.rs index 90cfafca9..a5e0ad859 100644 --- a/tonic-web/src/call.rs +++ b/tonic-web/src/call.rs @@ -373,7 +373,7 @@ impl Encoding { } fn internal_error(e: impl std::fmt::Display) -> Status { - Status::internal(format!("tonic-web: {}", e)) + Status::internal(format!("tonic-web: {e}")) } // Key-value pairs encoded as a HTTP/1 headers block (without the terminating newline) @@ -434,9 +434,9 @@ fn decode_trailers_frame(mut buf: Bytes) -> Result, Status> { .unwrap_or(value); let header_key = HeaderName::try_from(key) - .map_err(|e| Status::internal(format!("Unable to parse HeaderName: {}", e)))?; + .map_err(|e| Status::internal(format!("Unable to parse HeaderName: {e}")))?; let header_value = HeaderValue::try_from(value) - .map_err(|e| Status::internal(format!("Unable to parse HeaderValue: {}", e)))?; + .map_err(|e| Status::internal(format!("Unable to parse HeaderValue: {e}")))?; map.insert(header_key, header_value); } @@ -479,8 +479,7 @@ fn find_trailers(buf: &[u8]) -> Result { if !(header == 0 || header == 1) { return Err(Status::internal(format!( - "Invalid header bit {} expected 0 or 1", - header + "Invalid header bit {header} expected 0 or 1" ))); } diff --git a/tonic-web/src/service.rs b/tonic-web/src/service.rs index ab9abc0b8..e0d75f4b3 100644 --- a/tonic-web/src/service.rs +++ b/tonic-web/src/service.rs @@ -359,8 +359,7 @@ mod tests { assert_eq!( res.status(), StatusCode::METHOD_NOT_ALLOWED, - "{} should not be allowed", - method + "{method} should not be allowed" ); } } @@ -445,7 +444,7 @@ mod tests { let mut req = request(); req.headers_mut().insert( CONTENT_TYPE, - HeaderValue::from_maybe_shared(format!("application/{}", variant)).unwrap(), + HeaderValue::from_maybe_shared(format!("application/{variant}")).unwrap(), ); let res = svc.call(req).await.unwrap(); diff --git a/tonic/src/codec/decode.rs b/tonic/src/codec/decode.rs index 4742291fd..60c0c9d35 100644 --- a/tonic/src/codec/decode.rs +++ b/tonic/src/codec/decode.rs @@ -172,11 +172,10 @@ impl StreamingInner { trace!("unexpected compression flag"); let message = if let Direction::Response(status) = self.direction { format!( - "protocol error: received message with invalid compression flag: {} (valid flags are 0 and 1) while receiving response with status: {}", - f, status + "protocol error: received message with invalid compression flag: {f} (valid flags are 0 and 1) while receiving response with status: {status}" ) } else { - format!("protocol error: received message with invalid compression flag: {} (valid flags are 0 and 1), while sending request", f) + format!("protocol error: received message with invalid compression flag: {f} (valid flags are 0 and 1), while sending request") }; return Err(Status::internal(message)); } @@ -189,8 +188,7 @@ impl StreamingInner { if len > limit { return Err(Status::out_of_range( format!( - "Error, decoded message length too large: found {} bytes, the limit is: {} bytes", - len, limit + "Error, decoded message length too large: found {len} bytes, the limit is: {limit} bytes" ), )); } @@ -224,11 +222,10 @@ impl StreamingInner { ) { let message = if let Direction::Response(status) = self.direction { format!( - "Error decompressing: {}, while receiving response with status: {}", - err, status + "Error decompressing: {err}, while receiving response with status: {status}" ) } else { - format!("Error decompressing: {}, while sending request", err) + format!("Error decompressing: {err}, while sending request") }; return Err(Status::internal(message)); } @@ -280,7 +277,7 @@ impl StreamingInner { Ok(None) } else { - panic!("unexpected frame: {:?}", frame); + panic!("unexpected frame: {frame:?}"); }) } diff --git a/tonic/src/codec/encode.rs b/tonic/src/codec/encode.rs index 52952ff5b..7568f0515 100644 --- a/tonic/src/codec/encode.rs +++ b/tonic/src/codec/encode.rs @@ -154,7 +154,7 @@ where encoder .encode(item, &mut EncodeBuf::new(uncompression_buf)) - .map_err(|err| Status::internal(format!("Error encoding: {}", err)))?; + .map_err(|err| Status::internal(format!("Error encoding: {err}")))?; let uncompressed_len = uncompression_buf.len(); @@ -167,11 +167,11 @@ where buf, uncompressed_len, ) - .map_err(|err| Status::internal(format!("Error compressing: {}", err)))?; + .map_err(|err| Status::internal(format!("Error compressing: {err}")))?; } else { encoder .encode(item, &mut EncodeBuf::new(buf)) - .map_err(|err| Status::internal(format!("Error encoding: {}", err)))?; + .map_err(|err| Status::internal(format!("Error encoding: {err}")))?; } // now that we know length, we can write the header @@ -187,8 +187,7 @@ fn finish_encoding( let limit = max_message_size.unwrap_or(DEFAULT_MAX_SEND_MESSAGE_SIZE); if len > limit { return Err(Status::out_of_range(format!( - "Error, encoded message length too large: found {} bytes, the limit is: {} bytes", - len, limit + "Error, encoded message length too large: found {len} bytes, the limit is: {limit} bytes" ))); } diff --git a/tonic/src/metadata/encoding.rs b/tonic/src/metadata/encoding.rs index cf2c38a53..46eae8ee2 100644 --- a/tonic/src/metadata/encoding.rs +++ b/tonic/src/metadata/encoding.rs @@ -139,7 +139,7 @@ impl self::value_encoding::Sealed for Binary { fn from_static(value: &'static str) -> HeaderValue { if crate::util::base64::STANDARD.decode(value).is_err() { - panic!("Invalid base64 passed to from_static: {}", value); + panic!("Invalid base64 passed to from_static: {value}"); } unsafe { // Because this is valid base64 this must be a valid HTTP header value, @@ -173,9 +173,9 @@ impl self::value_encoding::Sealed for Binary { fn fmt(value: &HeaderValue, f: &mut fmt::Formatter<'_>) -> fmt::Result { if let Ok(decoded) = Self::decode(value.as_bytes()) { - write!(f, "{:?}", decoded) + write!(f, "{decoded:?}") } else { - write!(f, "b[invalid]{:?}", value) + write!(f, "b[invalid]{value:?}") } } } diff --git a/tonic/src/metadata/value.rs b/tonic/src/metadata/value.rs index eb9eeda1c..46086279a 100644 --- a/tonic/src/metadata/value.rs +++ b/tonic/src/metadata/value.rs @@ -795,13 +795,13 @@ fn test_debug() { for &(value, expected) in cases { let val = AsciiMetadataValue::try_from(value.as_bytes()).unwrap(); - let actual = format!("{:?}", val); + let actual = format!("{val:?}"); assert_eq!(expected, actual); } let mut sensitive = AsciiMetadataValue::from_static("password"); sensitive.set_sensitive(true); - assert_eq!("Sensitive", format!("{:?}", sensitive)); + assert_eq!("Sensitive", format!("{sensitive:?}")); } #[test] diff --git a/tonic/src/request.rs b/tonic/src/request.rs index 0f54f9785..e2d382270 100644 --- a/tonic/src/request.rs +++ b/tonic/src/request.rs @@ -408,7 +408,7 @@ fn duration_to_grpc_timeout(duration: Duration) -> String { if value > max_size { None } else { - Some(format!("{}{}", value, unit)) + Some(format!("{value}{unit}")) } } diff --git a/tonic/src/status.rs b/tonic/src/status.rs index 057e7a542..374b566a0 100644 --- a/tonic/src/status.rs +++ b/tonic/src/status.rs @@ -361,7 +361,7 @@ impl Status { fn from_h2_error(err: Box) -> Status { let code = Self::code_from_h2(&err); - let mut status = Self::new(code, format!("h2 protocol error: {}", err)); + let mut status = Self::new(code, format!("h2 protocol error: {err}")); status.source = Some(Arc::new(*err)); status } @@ -421,7 +421,7 @@ impl Status { #[cfg(feature = "server")] if let Some(h2_err) = err.source().and_then(|e| e.downcast_ref::()) { let code = Status::code_from_h2(h2_err); - let status = Self::new(code, format!("h2 protocol error: {}", err)); + let status = Self::new(code, format!("h2 protocol error: {err}")); return Some(status); } diff --git a/tonic/src/transport/channel/service/user_agent.rs b/tonic/src/transport/channel/service/user_agent.rs index bbcc1caca..8217d55e6 100644 --- a/tonic/src/transport/channel/service/user_agent.rs +++ b/tonic/src/transport/channel/service/user_agent.rs @@ -77,7 +77,7 @@ mod tests { fn prepends_custom_user_agent_to_default() { assert_eq!( UserAgent::new(Svc, Some(HeaderValue::from_static("Greeter 1.1"))).user_agent, - HeaderValue::from_str(&format!("Greeter 1.1 {}", TONIC_USER_AGENT)).unwrap() + HeaderValue::from_str(&format!("Greeter 1.1 {TONIC_USER_AGENT}")).unwrap() ) } @@ -115,7 +115,7 @@ mod tests { #[tokio::test] async fn sets_custom_user_agent_if_none_present() { - let expected_user_agent = format!("Greeter 1.1 {}", TONIC_USER_AGENT); + let expected_user_agent = format!("Greeter 1.1 {TONIC_USER_AGENT}"); let mut ua = UserAgent::new( TestSvc { expected_user_agent, @@ -131,7 +131,7 @@ mod tests { req.headers_mut() .insert(USER_AGENT, HeaderValue::from_static("request-ua/x.y")); - let expected_user_agent = format!("request-ua/x.y {}", TONIC_USER_AGENT); + let expected_user_agent = format!("request-ua/x.y {TONIC_USER_AGENT}"); let mut ua = UserAgent::new( TestSvc { expected_user_agent, @@ -147,7 +147,7 @@ mod tests { req.headers_mut() .insert(USER_AGENT, HeaderValue::from_static("request-ua/x.y")); - let expected_user_agent = format!("request-ua/x.y Greeter 1.1 {}", TONIC_USER_AGENT); + let expected_user_agent = format!("request-ua/x.y Greeter 1.1 {TONIC_USER_AGENT}"); let mut ua = UserAgent::new( TestSvc { expected_user_agent, From 1c139f35efab82b1bea103e4ee469a05259e6441 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Thu, 1 May 2025 14:09:12 -0400 Subject: [PATCH 54/61] chore: Add `flake.nix` (#2261) --- .github/workflows/CI.yml | 2 +- flake.lock | 181 +++++++++++++++++++++++++++++++++++++ flake.nix | 73 +++++++++++++++ interop/test.sh | 12 +-- interop/update_binaries.sh | 3 +- prepare-release.sh | 2 +- 6 files changed, 264 insertions(+), 9 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fec6cdb87..fd3339629 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -93,7 +93,7 @@ jobs: CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback - name: Get MSRV from manifest file id: msrv - run: echo "version=$(yq '.workspace.package.rust-version' Cargo.toml)" >> $GITHUB_OUTPUT + run: echo "version=$(yq '.workspace.package.rust-version' Cargo.toml)" >> "$GITHUB_OUTPUT" - uses: hecrj/setup-rust-action@v2 with: rust-version: ${{ steps.msrv.outputs.version }} diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..f257c3ba2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,181 @@ +{ + "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1746081462, + "narHash": "sha256-WmJBaktb33WwqNn5BwdJghAoiBnvnPhgHSBksTrF5K8=", + "owner": "nix-community", + "repo": "fenix", + "rev": "e3be528e4f03538852ba49b413ec4ac843edeb60", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1742649964, + "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1745930157, + "narHash": "sha256-y3h3NLnzRSiUkYpnfvnS669zWZLoqqI6NprtLQ+5dck=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "46e634be05ce9dc6d4db8e664515ba10b78151ae", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1743296961, + "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "fenix": "fenix", + "flake-parts": "flake-parts", + "git-hooks": "git-hooks", + "nixpkgs": "nixpkgs", + "treefmt-nix": "treefmt-nix" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1746024678, + "narHash": "sha256-Q5J7+RoTPH4zPeu0Ka7iSXtXty228zKjS0Ed4R+ohpA=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "5d66d45005fef79751294419ab9a9fa304dfdf5c", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1745929750, + "narHash": "sha256-k5ELLpTwRP/OElcLpNaFWLNf8GRDq4/eHBmFy06gGko=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "82bf32e541b30080d94e46af13d46da0708609ea", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..790151849 --- /dev/null +++ b/flake.nix @@ -0,0 +1,73 @@ +{ + description = "Description for the project"; + + inputs = { + flake-parts.url = "github:hercules-ci/flake-parts"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + git-hooks = { + url = "github:cachix/git-hooks.nix"; + inputs = { nixpkgs.follows = "nixpkgs"; }; + }; + + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = inputs@{ self, flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + imports = [ inputs.git-hooks.flakeModule inputs.treefmt-nix.flakeModule ]; + systems = + [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; + perSystem = { config, pkgs, system, ... }: + let rustToolchain = pkgs.fenix.stable; + in { + _module.args.pkgs = import inputs.nixpkgs { + inherit system; + overlays = [ inputs.fenix.overlays.default ]; + config = { }; + }; + + formatter = config.treefmt.build.wrapper; + checks.formatting = config.treefmt.build.check self; + + pre-commit = { + check.enable = true; + settings.hooks = { + actionlint.enable = true; + shellcheck.enable = true; + treefmt.enable = true; + }; + }; + + treefmt = { + settings = { rustfmt.enable = true; }; + projectRootFile = ".git/config"; + flakeCheck = false; # Covered by git-hooks check + }; + + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + nixd + nixfmt + + (rustToolchain.withComponents [ + "cargo" + "clippy" + "rust-src" + "rustc" + "rustfmt" + "rust-analyzer" + ]) + protobuf + ]; + }; + }; + }; +} diff --git a/interop/test.sh b/interop/test.sh index 1814b2df4..6208a8117 100755 --- a/interop/test.sh +++ b/interop/test.sh @@ -47,7 +47,7 @@ TLS_CRT="interop/data/server1.pem" TLS_KEY="interop/data/server1.key" # run the test server -./"${SERVER}" ${ARG} --tls_cert_file $TLS_CRT --tls_key_file $TLS_KEY & +./"${SERVER}" "${ARG}" --tls_cert_file $TLS_CRT --tls_key_file $TLS_KEY & SERVER_PID=$! echo ":; started grpc-go test server." @@ -57,12 +57,12 @@ trap 'echo ":; killing test server"; kill ${SERVER_PID};' EXIT sleep 1 -./target/debug/client --test_case="${JOINED_TEST_CASES}" ${ARG} +./target/debug/client --test_case="${JOINED_TEST_CASES}" "${ARG}" -echo ":; killing test server"; kill ${SERVER_PID}; +echo ":; killing test server"; kill "${SERVER_PID}"; # run the test server -./target/debug/server ${ARG} & +./target/debug/server "${ARG}" & SERVER_PID=$! echo ":; started tonic test server." @@ -72,7 +72,7 @@ trap 'echo ":; killing test server"; kill ${SERVER_PID};' EXIT sleep 1 -./target/debug/client --test_case="${JOINED_TEST_CASES}" ${ARG} +./target/debug/client --test_case="${JOINED_TEST_CASES}" "${ARG}" TLS_ARGS="" @@ -81,5 +81,5 @@ if [ -n "${ARG}" ]; then fi for CASE in "${TEST_CASES[@]}"; do - interop/bin/client_${OS}_amd64${EXT} --test_case="${CASE}" ${TLS_ARGS} + interop/bin/client_${OS}_amd64${EXT} --test_case="${CASE}" "${TLS_ARGS}" done diff --git a/interop/update_binaries.sh b/interop/update_binaries.sh index 79d3ba4ba..c11f93728 100755 --- a/interop/update_binaries.sh +++ b/interop/update_binaries.sh @@ -1,3 +1,4 @@ +#!/bin/bash set -e # This script updates server and client go binaries for interop tests. @@ -30,4 +31,4 @@ for ROLE in $ROLES; do done done -rm -rf ../grpc-go \ No newline at end of file +rm -rf ../grpc-go diff --git a/prepare-release.sh b/prepare-release.sh index 1c5254bd4..f5e13bb63 100755 --- a/prepare-release.sh +++ b/prepare-release.sh @@ -14,7 +14,7 @@ fi DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" VERSION="$1" -MINOR="$( echo ${VERSION} | cut -d\. -f1-2 )" +MINOR="$( echo "${VERSION}" | cut -d\. -f1-2 )" VERSION_MATCHER="([a-z0-9\\.-]+)" TONIC_CRATE_MATCHER="(tonic|tonic-[a-z]+)" From eeac1d3ac5873c4af1e7e3c5f95185395d1b63a1 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Thu, 1 May 2025 14:30:18 -0400 Subject: [PATCH 55/61] chore: Fix interop test certs (#2262) * chore: Fix interop test certs * fix bash script: --- interop/data/ca.pem | 32 ++++++++++++------------- interop/data/server1.key | 50 ++++++++++++++++++++-------------------- interop/data/server1.pem | 32 ++++++++++++------------- interop/test.sh | 20 ++++++++++++---- 4 files changed, 72 insertions(+), 62 deletions(-) diff --git a/interop/data/ca.pem b/interop/data/ca.pem index 841147934..4176c0370 100644 --- a/interop/data/ca.pem +++ b/interop/data/ca.pem @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDRjCCAi6gAwIBAgIQQS24If9oGkeiIDhCX3LptTANBgkqhkiG9w0BAQsFADA9 +MIIDRjCCAi6gAwIBAgIQd5pnuFdwgGxb4RiClYEPMTANBgkqhkiG9w0BAQsFADA9 MQ4wDAYDVQQKEwVUb2tpbzEQMA4GA1UECxMHVGVzdGluZzEZMBcGA1UEAxMQVG9u -aWMgVGVzdGluZyBDQTAeFw0yNDExMTMxOTQ0MzBaFw0zNDExMTExOTQ0MzBaMD0x +aWMgVGVzdGluZyBDQTAeFw0yNTA1MDExNzQyNThaFw0zNTA0MjkxNzQyNThaMD0x DjAMBgNVBAoTBVRva2lvMRAwDgYDVQQLEwdUZXN0aW5nMRkwFwYDVQQDExBUb25p -YyBUZXN0aW5nIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuRMq -OMDsXvkEc/ArFxHhNNd1qIRhgPElLR/de091WVEKGGQI7OEJLE5/dfD2RMe0PdvZ -tEhURM/SUkreYeJhC7AFbAVM6cDC7Lj+GB1v63EbpFTDkkrJ5+GN7DtID/FNYg4M -sBlHCMys2ZWByAy6/fBZ4PKyJbMX4gtySLAyCTqI/BV1TC/7tgxiNrSNv/MZiqqO -FOdAfpkdb/mGWkxOB+JYWT8QBjIWcWaoWJcwmlY4ZC6U5aaNxO3VKDdGyghKkPS7 -nDAMe5H3Cl/rR1TKY3A9TVcE4qQ514647NQpCoOJZ39PbXJy+S4v3qI61IvFBPFh -C3tgZABh8h9dO7ddGQIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAgQwDwYDVR0TAQH/ -BAUwAwEB/zAdBgNVHQ4EFgQU6k4lLdVI7YCNA9eQBb8hO3nIFVQwDQYJKoZIhvcN -AQELBQADggEBADhJOxK2tPlai1pSwT0ud7oXXfAQpI1PZ9FxWR9qx1UsTLb3sfTW -+20RQdguGXTby5wkHIiVJ6vAEDRd8X9oOf8vk2zvnmWLgiDdOh3e3OkOme6Qs+V9 -mXIA8JZnYGaqmAPcmZU5uY2lrf0oXURqb9ZNL5DCc1yJ1rVC3jCQLZZ1v6GGRNB5 -YhTWlQYUcu2nw8fN1scrV9322gU5siJzrNrjO9yabIYZyMpwcNwarvoxcVT8zLM5 -ZLUTjG2Yr8PJ13Bn2dyw8mDuL0ixXU34vQNIHBk1UmbzyWL9mDfu9RfpIDIDkEzK -sO/HXgh4vzETaIhkEuW9porYX5d1QyVED8I= +YyBUZXN0aW5nIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2C37 +LVCs4RfNdwv8NMZfIdFNqrUdwzXZ+a5B7Pee1nOL+JD9feOGn1qGZI1ZgFMqVygN +ejSkzlbouN9RAGgyBmOFFo3oEc+nz7kPrezBLoM3oVgNzhEixz2IQoafoZX3j48Y +fpGYmrTHUp4MAwUAt6Zb+kD7YGqD8//I5OMM4Y5R8yuYGsJHUUSZqYfgXCk0ZvVG +EX7zyr31cVLqto1vpuv5Uvp6WX5oGgbZVB0wvlqs9Ak+dblWBZQIsrUPU8kn/6kx +HilF8Lw24dRXr5oveFDMdD/n4sIh7Gr/O+VGH83gP/PawXy0WWn5qGAhdx+P99jI +UGAWNetu4vGgASLFkwIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAgQwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQU4AI0rUoGKFxe0gXIYujrhnuNsocwDQYJKoZIhvcN +AQELBQADggEBAEtSrTgz+suVMDRsdvxG7+BAcXfVc8pmou3KIFbDtIyog2BEU5nU +Z+zBqrVgbGv9B4D7XLcZgTShY17cvJP8QpUwT/gzI9uR8Lig9JGF7n1K43+aiAk9 +s7H8e74rwyPX6mRmuznd1sJdDsc5lohUPpZVI+7pRywedQw+QG6/n2cVvR0k0Txh +pF1XBpzuFA5t5uqW/v/QFqfGEuIDDMdW2JQSEB7UyH4V2yWswoYb/uf/xoNXWWqs +Y6RVSp6qVW8748rPPwmLaN8hHGIUNUnilQIXr67bX8i3FjoLHhQvKqUEKciXJWj9 +ssGOvq0QoVZNPltcZp9yID3W2kyxv6Hq8VA= -----END CERTIFICATE----- diff --git a/interop/data/server1.key b/interop/data/server1.key index 064de36c8..e7666ab67 100644 --- a/interop/data/server1.key +++ b/interop/data/server1.key @@ -1,27 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEogIBAAKCAQEA3IN57h6uzOii4giaDPPMhjc1Dm0gpX4GiwKCeo8jhhN37YjK -OLCLGEYOoyBoMiYr/A5neJ6eixpp9qHGlq3youOHW81dEGqqtasTH7jdXFbnIY72 -Nz8DftzxD8XXrQu8ZjzHWRbFcmvApWEt/7GE1mhUAIDURTdf4JkqeOCVRnGWNat1 -owjypqjhpXGYG/TTfqT+Tw5987O3ZotBjcv//WLEmx1GhKKYKCFeDiRH9ozEtInH -vBOP7u2kE1kU+7V1ijG/vdHSS5/E/KrXMVqxzoES58XNtUqsRH09Gji8ad/cD5GC -k/3f9ZzUFVO33pnnyY5by6QbBevKQe1Jki0WTwIDAQABAoIBAHXbI0jcR0qnL58l -P8iaaP529Tlvo9ovgCm9vqToafEX6KogyQwBd2YS03HmOSpMcoe13yF9jXkFNgsm -LbCM6bibaNXs7cd/axvLgl4a/NyEaeXqtbeTSzf7uC9Y60vGkPwHkfgQjpj39C+v -v9kANOIvQm4+bLVNwkWVNzkBt2a9AlyQJYaeKLWkVKPeoDF9UpdS9CovMQSJ5kZ/ -3I1old4C/AwC7WyyvNikSKwFGH+Sf/2v3RwwsTz4OJbi208A9riwfNJ4YMYC5vFQ -Y28xOPSYhXjuHMeKZV6KP5WKr+bELOzoj1zl1x3SZSZbTszAi8Gz1FTXRVPpCGOQ -HrK+RakCgYEA+kv99xw+zM+YvXYdlj5dF/EofSiD7eU+ASQ64+gnfhZiUeAWqssD -4VK6sS4DYlS0h1TkLtrO3iCYOUD+S9RsqOzUXft5a1wqWYiBa9QOpa6MV3s8DeS9 -wBK8BzMOtrPEsqKwrOe302MV2Aw1GabNVi0aLQPZQvYZBt7Hhe4eXasCgYEA4YnB -W8aPVS3953pQHH9Z6l39oy25GktRzHH3HpnFuSTgumvOvOE9LSLKmMoDpN2Krv4T -1cK2WwLOb+SjOkcY0A1j4+AVLsP9PJbRJbsP7OOVRB1Do7kFzQ9bEGHFpGD3lAkz -ClQSRkivLMsd86m1ivc80cmhNnOgpygteRJcHe0CgYAhhlAr6wKWWC/zIIDyAMRj -Uo/Dw8t3776QVJP2tr+jacgdg1BF7A9G/Ne4p5sYbpQHlF1D0Vbn9aGt+YCWE4vC -TIZdWDN5J80cVOZQ1QRpOKnfhcgTbFHmChxZMoOEASwVaSkU36yFib4BRBFQsEDM -jBn3cY6GI4RSoUBENhKnJQKBgEYAUKBgl5ozhSv0XasKp+jDNXcROPN9Ty0qbi30 -Qlc9p/aUgX1EV42Lz9/uS4U/Mc0wlQ1yutCypUo7Z6It8PiaP1e59DkooY/Nq6qP -TdkTpf+XKahGRBOqYXRLNGHZqt4qoMni4C0qYByCCpDXKr6wEBN5Bm11I/bd1IdQ -eIDdAoGAKAS/R07REX3klh/TV31YdfhaQfrhtVLQ4LArfEE13XOHF2zILkO849Gf -XpKtcIXDh9JVK7XagreHnYThBigEnmQckwfc1AoJf/KmCa+PSrsDMTdR0IMHIcr3 -zgchjL3chUpgvj2ckaqXf4qxUml0Lgm/qF45mJ7ut5k9TcKiKyY= +MIIEpAIBAAKCAQEA7iJJ8gLlKsp+r15CR15Iz2rmi3f3OZmA8FZ0hpB5hNkQHfVA +RlC2yawIfHiLO4tpUmjtX8iq3RXPkKPYP5Zfd1BDLdR/2qhd3vFJnRVfoiqTMNOV +3R3+tIm04gDbtGxIDuWL+No/r/KldFxwbLqYTXDOaa145YI2aZ3GZ3P6GFYls6h7 +PeUqlXv7yWx1jfcMIZPeupHwWESYCCLkpvBHFZftWhc/FChUmgr417vmQC2eGwuX +LyRdu+Lv9NmSzsO6A+w8ss62ewC02LXkXAG2Prd1GYuScsq94GcE5lguC5TVkdTm +tQMDmET/KvitG3vLB9AIkKnjZdi1Ml7Ow6dByQIDAQABAoIBAFo7ketrH2z8d855 +mAG0/z/hEOSuG3au7MWk7NiEbBdjrJC9epJqSSjX0AtiHdf9NnZsne2aeuv1NMZo +3ysRDrGGLz5xc9Tl0VQF98/W5nrrSQTKV9IGaJn+SBUPIDEYiqFiZ4xvHozME9eo +o0z/03Acm4o9mj7U/Us95o0SzCRl3QKgAWeSS36Ks0OmDJfNuYBWf+WA7Fte9NUp +yOOm2fGejoge9eMcJY3/7HckrESscMECZMUL1hBbVD939d4S4AvM6YWTErAa9uq9 +APsXdu5IYglonqw6oc4TtN9bI9gbHKTyiFgi42gM6qcN2ixpQ78ufktLcJLBTLzi +jP5f5cUCgYEA7whtTRG+KN3nAaRy5gU3JDdOIM1tlAVjwtvUIre3sf6p6Bzs0+RL +DVdOidJB+8wnV6hF64+juHS27Y7t4ONt2VRFNmY3yRlb9MwqOYlqGaOOewgY+Gab +ZC4GBKmMRKW0LpeRHghpCeyeRRKr5tkYalyU9/C+mxIFpb0/NZZXh6sCgYEA/wmG +s+npJH2Xs17Yd3wwroZpFAlG2wRCd0IS14brKr+w5czbGis8Pz/LCVrNH+6ZkvoI +gUpTDwY7egt9O2iCIeSeq82Ov+g9WiDa150YTq8av09N7AZ13Na+SU5aNpPwIOEZ +WX8dygNloSh4JDjOhrwigRtcMmYCtpKVS792GFsCgYEA6QEB6rp870E/ya4QAoDa ++4adtgQJ6NxIHs5Cv4Tun6dq4EQx52sGbf7JJDe88kJTp3L0lWbzZP8AwhktcKbB +kbQ/s4N4paL+rGXIU0XMEyoH3Y5LKPh8SO9EFo9fmBsexLwiTXBNU8s/jH1i7Ch7 +UFLnM7mNU4QB1Ungr8/ZivkCgYA6sA2ATz5oOEJ1c0jqzfhB4QpDIxNcCPHmkZzW +XeS11KC3cNmmfvaBM4PcZjm3tGdArCrS3bCZT3zWS9iImDcB56Mfs9C6lo2vtMnH +Pg4+5QqJpY0v2Bi9NelZ4x7dWlOyrTnxH1BSkU+Ms0xaQXw9AwQJo6smqdTMAJU8 +dhWN6wKBgQDRAjpfV77FE32XsBkHyGlaIanxu+gSJVLaHStZLV8qTvn//lnmr5Be +abK4smlwHp5ZnTwqP3gMh/b8vfyPYHdK/2rCKSCEPf/JHtoABsw9Hvkr/N99MZQd +S2l3PYQoQ8smUVYNWhdYvdRER8WFTk5rPX6fEoVne/sArxlwk8+8nw== -----END RSA PRIVATE KEY----- diff --git a/interop/data/server1.pem b/interop/data/server1.pem index 3bcad6b8d..a64fc275e 100644 --- a/interop/data/server1.pem +++ b/interop/data/server1.pem @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDTDCCAjSgAwIBAgIRAOV5RsOfZrNiE0WwnPv5MSswDQYJKoZIhvcNAQELBQAw +MIIDTDCCAjSgAwIBAgIRAL1ZcIwdi/AfgLm2T41fHO4wDQYJKoZIhvcNAQELBQAw PTEOMAwGA1UEChMFVG9raW8xEDAOBgNVBAsTB1Rlc3RpbmcxGTAXBgNVBAMTEFRv -bmljIFRlc3RpbmcgQ0EwHhcNMjQxMTEzMTk0NDMwWhcNMjkxMTEyMTk0NDMwWjAh +bmljIFRlc3RpbmcgQ0EwHhcNMjUwNTAxMTc0MjU4WhcNMzAwNDMwMTc0MjU4WjAh MR8wHQYDVQQDExZUb25pYyBUZXN0IFNlcnZlciBDZXJ0MIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEA3IN57h6uzOii4giaDPPMhjc1Dm0gpX4GiwKCeo8j -hhN37YjKOLCLGEYOoyBoMiYr/A5neJ6eixpp9qHGlq3youOHW81dEGqqtasTH7jd -XFbnIY72Nz8DftzxD8XXrQu8ZjzHWRbFcmvApWEt/7GE1mhUAIDURTdf4JkqeOCV -RnGWNat1owjypqjhpXGYG/TTfqT+Tw5987O3ZotBjcv//WLEmx1GhKKYKCFeDiRH -9ozEtInHvBOP7u2kE1kU+7V1ijG/vdHSS5/E/KrXMVqxzoES58XNtUqsRH09Gji8 -ad/cD5GCk/3f9ZzUFVO33pnnyY5by6QbBevKQe1Jki0WTwIDAQABo2MwYTATBgNV -HSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFOpOJS3V -SO2AjQPXkAW/ITt5yBVUMBsGA1UdEQQUMBKCECoudGVzdC5nb29nbGUuZnIwDQYJ -KoZIhvcNAQELBQADggEBABdvT3D98vfZxGPXddVG6SYMXLzoWrvF4R0joI2xzaiZ -XlLwo2pPiYY/mUNjNEQCbz9cV4E+EWFzP36YSiFpiQHH65zhgMRMBTlwe6ma+ksJ -kiBwwcDaugDGBrC5YGAypMB+a/8PZiUkODp6S/A4DgNCO4RO+c+lG1QCO335i41A -hVJZVQUKQ2t8SbkVQmugDfZFrp/fDJVRGKwNKWM1d3B40/6TaUc0z9jHBGOzy3GI -ZcO2Di5vqE+gY0oSb4MLlR3PIavPQvNhHCejD6qxIpivOMEpdNv2oAkcfoePuJQ3 -TfqJO8ybedfAGYf/p70Dw45lY7+/aGLIhnQ8nHQmUZE= +AQEFAAOCAQ8AMIIBCgKCAQEA7iJJ8gLlKsp+r15CR15Iz2rmi3f3OZmA8FZ0hpB5 +hNkQHfVARlC2yawIfHiLO4tpUmjtX8iq3RXPkKPYP5Zfd1BDLdR/2qhd3vFJnRVf +oiqTMNOV3R3+tIm04gDbtGxIDuWL+No/r/KldFxwbLqYTXDOaa145YI2aZ3GZ3P6 +GFYls6h7PeUqlXv7yWx1jfcMIZPeupHwWESYCCLkpvBHFZftWhc/FChUmgr417vm +QC2eGwuXLyRdu+Lv9NmSzsO6A+w8ss62ewC02LXkXAG2Prd1GYuScsq94GcE5lgu +C5TVkdTmtQMDmET/KvitG3vLB9AIkKnjZdi1Ml7Ow6dByQIDAQABo2MwYTATBgNV +HSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFOACNK1K +BihcXtIFyGLo64Z7jbKHMBsGA1UdEQQUMBKCECoudGVzdC5nb29nbGUuZnIwDQYJ +KoZIhvcNAQELBQADggEBAJP9h4voqemt8Jiw9lgXKOfZyydIHKvL8oeeNQLnn+Ch +S8D32xRxDeql0oghbTFj1AUxs5X415YgyP4JBoQ8X+L7z3hvSHHildJjbDAM5l+D +jHIr/G6+N6DzLi75WUpZkHFa0ZZ+jHkrxRFq3SsS2hzL93sZ8HoLoEXgGJYcuVYh +duWmy1pv/TW8j3GcRE358rLyIzsAK2tJZOHC3MeDqvITfGfzeHxy/UG2bbGmXU8Z +UoCFUGHhukNuESQFfPxoHsWnsxvCIvcIxGPj4NXSO0WJ9r7/A+UczSr+Vuc55h0E +qrAl9EXltUWTjRZwdIvvas9N3y0ApxkMFNIRmMwUBGE= -----END CERTIFICATE----- diff --git a/interop/test.sh b/interop/test.sh index 6208a8117..c4628d164 100755 --- a/interop/test.sh +++ b/interop/test.sh @@ -74,12 +74,22 @@ sleep 1 ./target/debug/client --test_case="${JOINED_TEST_CASES}" "${ARG}" -TLS_ARGS="" - -if [ -n "${ARG}" ]; then - TLS_ARGS="--use_tls --use_test_ca --server_host_override=foo.test.google.fr --ca_file=${TLS_CA}" +# Run client test cases +if [ -n "${ARG:-}" ]; then + TLS_ARRAY=( \ + -use_tls \ + -use_test_ca \ + -server_host_override=foo.test.google.fr \ + -ca_file="${TLS_CA}" \ + ) +else + TLS_ARRAY=() fi for CASE in "${TEST_CASES[@]}"; do - interop/bin/client_${OS}_amd64${EXT} --test_case="${CASE}" "${TLS_ARGS}" + flags=( "-test_case=${CASE}" ) + flags+=( "${TLS_ARRAY[@]}" ) + + interop/bin/client_"${OS}"_amd64"${EXT}" "${flags[@]}" done + From 67e2ef9da68bd45d29e60ae74890d57661f7ee23 Mon Sep 17 00:00:00 2001 From: Vigneshwar S <80331703+vigneshs-12@users.noreply.github.com> Date: Fri, 2 May 2025 01:19:24 +0530 Subject: [PATCH 56/61] fix: tls config overwrite in endpoint (#2252) * fix: tls config overwrite in endpoint PR #1866 fixed the breaking change introduced in #1731, but resets the TLS config without checking if `tls` is set. This patch resolves the regression and restores expected behaviour. * fix: cargo fmt whitespace check --------- Co-authored-by: vigneshwar.sm Co-authored-by: Lucio Franco --- tonic/src/transport/channel/endpoint.rs | 2 +- tonic/src/transport/channel/tls.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tonic/src/transport/channel/endpoint.rs b/tonic/src/transport/channel/endpoint.rs index 3a919e93d..99ff11e9f 100644 --- a/tonic/src/transport/channel/endpoint.rs +++ b/tonic/src/transport/channel/endpoint.rs @@ -62,7 +62,7 @@ impl Endpoint { let me = dst.try_into().map_err(|e| Error::from_source(e.into()))?; #[cfg(feature = "_tls-any")] if let EndpointType::Uri(uri) = &me.uri { - if uri.scheme() == Some(&http::uri::Scheme::HTTPS) { + if me.tls.is_none() && uri.scheme() == Some(&http::uri::Scheme::HTTPS) { return me.tls_config(ClientTlsConfig::new().with_enabled_roots()); } } diff --git a/tonic/src/transport/channel/tls.rs b/tonic/src/transport/channel/tls.rs index 945384fd2..59ecc36fd 100644 --- a/tonic/src/transport/channel/tls.rs +++ b/tonic/src/transport/channel/tls.rs @@ -113,11 +113,13 @@ impl ClientTlsConfig { /// Activates all TLS roots enabled through `tls-*-roots` feature flags pub fn with_enabled_roots(self) -> Self { - let config = ClientTlsConfig::new(); + let config = self; + #[cfg(feature = "tls-native-roots")] let config = config.with_native_roots(); #[cfg(feature = "tls-webpki-roots")] let config = config.with_webpki_roots(); + config } From 9669ce45aaf4123ed226eb9b37cf75e428e94bf7 Mon Sep 17 00:00:00 2001 From: Rafael RL Date: Thu, 1 May 2025 21:49:48 +0200 Subject: [PATCH 57/61] chore(tonic-bench): Fix failing bench (#2207) Co-authored-by: Lucio Franco --- tonic/Cargo.toml | 4 ++-- tonic/benches/decode.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tonic/Cargo.toml b/tonic/Cargo.toml index 95f929333..5a66e66ad 100644 --- a/tonic/Cargo.toml +++ b/tonic/Cargo.toml @@ -100,8 +100,8 @@ bencher = "0.1.5" quickcheck = "1.0" quickcheck_macros = "1.0" static_assertions = "1.0" -tokio = {version = "1.0", features = ["rt", "macros"]} -tower = {version = "0.5", features = ["load-shed", "timeout"]} +tokio = {version = "1.0", features = ["rt-multi-thread", "macros"]} +tower = {version = "0.5", features = ["full"]} [lints] workspace = true diff --git a/tonic/benches/decode.rs b/tonic/benches/decode.rs index a6a6e58a9..5ba4dfccc 100644 --- a/tonic/benches/decode.rs +++ b/tonic/benches/decode.rs @@ -73,7 +73,7 @@ impl Body for MockBody { } fn is_end_stream(&self) -> bool { - !self.data.is_empty() + self.data.is_empty() } fn size_hint(&self) -> SizeHint { From aa27260eb22edaa0a6b684924a219ea01f0ce645 Mon Sep 17 00:00:00 2001 From: Leon Hartley Date: Mon, 5 May 2025 15:24:27 +0100 Subject: [PATCH 58/61] feat: expose creation of HealthService and HealthReporter (#2251) * Expose creation of HealthService and HealthReporter * add default impl for HealthReporter --- tonic-health/src/server.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tonic-health/src/server.rs b/tonic-health/src/server.rs index a512b60fd..1a4d73e7f 100644 --- a/tonic-health/src/server.rs +++ b/tonic-health/src/server.rs @@ -37,7 +37,8 @@ pub struct HealthReporter { } impl HealthReporter { - fn new() -> Self { + /// Create a new HealthReporter with an initial service (named ""), corresponding to overall server health + pub fn new() -> Self { // According to the gRPC Health Check specification, the empty service "" corresponds to the overall server health let server_status = ("".to_string(), watch::channel(ServingStatus::Serving)); @@ -97,6 +98,12 @@ impl HealthReporter { } } +impl Default for HealthReporter { + fn default() -> Self { + Self::new() + } +} + /// A service providing implementations of gRPC health checking protocol. #[derive(Debug)] pub struct HealthService { @@ -108,6 +115,11 @@ impl HealthService { HealthService { statuses: services } } + /// Create a HealthService, carrying across the statuses from an existing HealthReporter + pub fn from_health_reporter(health_reporter: HealthReporter) -> Self { + Self::new(health_reporter.statuses) + } + async fn service_health(&self, service_name: &str) -> Option { let reader = self.statuses.read().await; reader.get(service_name).map(|p| *p.1.borrow()) From fd60c04721b358aa32ddb17b35b6d8f37824af1d Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Mon, 5 May 2025 10:44:48 -0400 Subject: [PATCH 59/61] [spr] initial version (#2264) Created using spr 1.3.6-beta.1 --- prepare-release.sh | 2 +- tonic-build/Cargo.toml | 2 +- tonic-health/Cargo.toml | 2 +- tonic-reflection/Cargo.toml | 2 +- tonic-types/Cargo.toml | 2 +- tonic-web/Cargo.toml | 2 +- tonic/Cargo.toml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/prepare-release.sh b/prepare-release.sh index f5e13bb63..365deacb6 100755 --- a/prepare-release.sh +++ b/prepare-release.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Script which automates modifying source version fields, and creating a release # commit and tag. The commit and tag are not automatically pushed, nor are the diff --git a/tonic-build/Cargo.toml b/tonic-build/Cargo.toml index e47b3307e..5592d3513 100644 --- a/tonic-build/Cargo.toml +++ b/tonic-build/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" name = "tonic-build" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.0" +version = "0.13.1" rust-version = { workspace = true } [dependencies] diff --git a/tonic-health/Cargo.toml b/tonic-health/Cargo.toml index fe6fd2a52..b9ef0ae54 100644 --- a/tonic-health/Cargo.toml +++ b/tonic-health/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" name = "tonic-health" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.0" +version = "0.13.1" rust-version = { workspace = true } [dependencies] diff --git a/tonic-reflection/Cargo.toml b/tonic-reflection/Cargo.toml index 7686c1e70..11fbfa304 100644 --- a/tonic-reflection/Cargo.toml +++ b/tonic-reflection/Cargo.toml @@ -14,7 +14,7 @@ license = "MIT" name = "tonic-reflection" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.0" +version = "0.13.1" rust-version = { workspace = true } [package.metadata.docs.rs] diff --git a/tonic-types/Cargo.toml b/tonic-types/Cargo.toml index 6ea75da69..3e9dba6c5 100644 --- a/tonic-types/Cargo.toml +++ b/tonic-types/Cargo.toml @@ -14,7 +14,7 @@ license = "MIT" name = "tonic-types" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.0" +version = "0.13.1" rust-version = { workspace = true } [dependencies] diff --git a/tonic-web/Cargo.toml b/tonic-web/Cargo.toml index 487efe709..ab0bf5a8c 100644 --- a/tonic-web/Cargo.toml +++ b/tonic-web/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" name = "tonic-web" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.0" +version = "0.13.1" rust-version = { workspace = true } [dependencies] diff --git a/tonic/Cargo.toml b/tonic/Cargo.toml index 5a66e66ad..06474b7ed 100644 --- a/tonic/Cargo.toml +++ b/tonic/Cargo.toml @@ -15,7 +15,7 @@ keywords = ["rpc", "grpc", "async", "futures", "protobuf"] license = "MIT" readme = "../README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.0" +version = "0.13.1" rust-version = {workspace = true} exclude = ["benches-disabled"] From ee6775c34ea12a804a32d70de2a1a2e956f06dd0 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Mon, 5 May 2025 10:45:10 -0400 Subject: [PATCH 60/61] Revert "[spr] initial version (#2264)" (#2265) --- prepare-release.sh | 2 +- tonic-build/Cargo.toml | 2 +- tonic-health/Cargo.toml | 2 +- tonic-reflection/Cargo.toml | 2 +- tonic-types/Cargo.toml | 2 +- tonic-web/Cargo.toml | 2 +- tonic/Cargo.toml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/prepare-release.sh b/prepare-release.sh index 365deacb6..f5e13bb63 100755 --- a/prepare-release.sh +++ b/prepare-release.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash # Script which automates modifying source version fields, and creating a release # commit and tag. The commit and tag are not automatically pushed, nor are the diff --git a/tonic-build/Cargo.toml b/tonic-build/Cargo.toml index 5592d3513..e47b3307e 100644 --- a/tonic-build/Cargo.toml +++ b/tonic-build/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" name = "tonic-build" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.1" +version = "0.13.0" rust-version = { workspace = true } [dependencies] diff --git a/tonic-health/Cargo.toml b/tonic-health/Cargo.toml index b9ef0ae54..fe6fd2a52 100644 --- a/tonic-health/Cargo.toml +++ b/tonic-health/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" name = "tonic-health" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.1" +version = "0.13.0" rust-version = { workspace = true } [dependencies] diff --git a/tonic-reflection/Cargo.toml b/tonic-reflection/Cargo.toml index 11fbfa304..7686c1e70 100644 --- a/tonic-reflection/Cargo.toml +++ b/tonic-reflection/Cargo.toml @@ -14,7 +14,7 @@ license = "MIT" name = "tonic-reflection" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.1" +version = "0.13.0" rust-version = { workspace = true } [package.metadata.docs.rs] diff --git a/tonic-types/Cargo.toml b/tonic-types/Cargo.toml index 3e9dba6c5..6ea75da69 100644 --- a/tonic-types/Cargo.toml +++ b/tonic-types/Cargo.toml @@ -14,7 +14,7 @@ license = "MIT" name = "tonic-types" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.1" +version = "0.13.0" rust-version = { workspace = true } [dependencies] diff --git a/tonic-web/Cargo.toml b/tonic-web/Cargo.toml index ab0bf5a8c..487efe709 100644 --- a/tonic-web/Cargo.toml +++ b/tonic-web/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" name = "tonic-web" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.1" +version = "0.13.0" rust-version = { workspace = true } [dependencies] diff --git a/tonic/Cargo.toml b/tonic/Cargo.toml index 06474b7ed..5a66e66ad 100644 --- a/tonic/Cargo.toml +++ b/tonic/Cargo.toml @@ -15,7 +15,7 @@ keywords = ["rpc", "grpc", "async", "futures", "protobuf"] license = "MIT" readme = "../README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.1" +version = "0.13.0" rust-version = {workspace = true} exclude = ["benches-disabled"] From b303caa52ba8bbe8172310be7165a80b7c2a53f8 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Mon, 5 May 2025 10:49:45 -0400 Subject: [PATCH 61/61] chore: Prepare `v0.13.1` release Reviewers: Pull Request: https://github.com/hyperium/tonic/pull/2266 --- prepare-release.sh | 2 +- tonic-build/Cargo.toml | 2 +- tonic-health/Cargo.toml | 2 +- tonic-reflection/Cargo.toml | 2 +- tonic-types/Cargo.toml | 2 +- tonic-web/Cargo.toml | 2 +- tonic/Cargo.toml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/prepare-release.sh b/prepare-release.sh index f5e13bb63..365deacb6 100755 --- a/prepare-release.sh +++ b/prepare-release.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Script which automates modifying source version fields, and creating a release # commit and tag. The commit and tag are not automatically pushed, nor are the diff --git a/tonic-build/Cargo.toml b/tonic-build/Cargo.toml index e47b3307e..5592d3513 100644 --- a/tonic-build/Cargo.toml +++ b/tonic-build/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" name = "tonic-build" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.0" +version = "0.13.1" rust-version = { workspace = true } [dependencies] diff --git a/tonic-health/Cargo.toml b/tonic-health/Cargo.toml index fe6fd2a52..b9ef0ae54 100644 --- a/tonic-health/Cargo.toml +++ b/tonic-health/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" name = "tonic-health" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.0" +version = "0.13.1" rust-version = { workspace = true } [dependencies] diff --git a/tonic-reflection/Cargo.toml b/tonic-reflection/Cargo.toml index 7686c1e70..11fbfa304 100644 --- a/tonic-reflection/Cargo.toml +++ b/tonic-reflection/Cargo.toml @@ -14,7 +14,7 @@ license = "MIT" name = "tonic-reflection" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.0" +version = "0.13.1" rust-version = { workspace = true } [package.metadata.docs.rs] diff --git a/tonic-types/Cargo.toml b/tonic-types/Cargo.toml index 6ea75da69..3e9dba6c5 100644 --- a/tonic-types/Cargo.toml +++ b/tonic-types/Cargo.toml @@ -14,7 +14,7 @@ license = "MIT" name = "tonic-types" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.0" +version = "0.13.1" rust-version = { workspace = true } [dependencies] diff --git a/tonic-web/Cargo.toml b/tonic-web/Cargo.toml index 487efe709..ab0bf5a8c 100644 --- a/tonic-web/Cargo.toml +++ b/tonic-web/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" name = "tonic-web" readme = "README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.0" +version = "0.13.1" rust-version = { workspace = true } [dependencies] diff --git a/tonic/Cargo.toml b/tonic/Cargo.toml index 5a66e66ad..06474b7ed 100644 --- a/tonic/Cargo.toml +++ b/tonic/Cargo.toml @@ -15,7 +15,7 @@ keywords = ["rpc", "grpc", "async", "futures", "protobuf"] license = "MIT" readme = "../README.md" repository = "https://github.com/hyperium/tonic" -version = "0.13.0" +version = "0.13.1" rust-version = {workspace = true} exclude = ["benches-disabled"]