Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cb6c67f
chore: Use symbolic link for license file (#2241)
tottoto Apr 30, 2025
97001f3
chore: Use inline format argument (#2260)
tottoto May 1, 2025
1c139f3
chore: Add `flake.nix` (#2261)
LucioFranco May 1, 2025
eeac1d3
chore: Fix interop test certs (#2262)
LucioFranco May 1, 2025
67e2ef9
fix: tls config overwrite in endpoint (#2252)
vigneshs-12 May 1, 2025
9669ce4
chore(tonic-bench): Fix failing bench (#2207)
rafaeling May 1, 2025
aa27260
feat: expose creation of HealthService and HealthReporter (#2251)
LeonHartley May 5, 2025
fd60c04
[spr] initial version (#2264)
LucioFranco May 5, 2025
ee6775c
Revert "[spr] initial version (#2264)" (#2265)
LucioFranco May 5, 2025
b303caa
chore: Prepare `v0.13.1` release
LucioFranco May 5, 2025
2138cdc
chore: Disable unused tower feature (#2270)
tottoto May 8, 2025
1315de8
chore(ci): Set RUSTFLAGS only on check job (#2271)
tottoto May 8, 2025
28534b5
chore: Update to webpki-roots 1 (#2269)
tottoto May 8, 2025
682d2db
chore(ci): Update to cargo-check-external-types 0.2 (#2272)
tottoto May 13, 2025
e4ba8b5
chore(ci): Set token permission to read (#2275)
tottoto May 13, 2025
696ea43
chore(test): Remove cargo-machete config (#2278)
tottoto May 20, 2025
689a86d
chore: Remove unused dependency (#2277)
tottoto May 22, 2025
2bd66e4
feat: add support for tower's load-shed layer (#2189)
joeroback Jun 7, 2025
5de7bad
chore: box Status contents (#2253) (#2282)
tustvold Jun 7, 2025
6d1a6a0
chore(doc): Fix outdated limit in comment (#2297)
darrasse Jun 12, 2025
5182252
feat: Update to prost 0.14 (#2300)
tottoto Jun 16, 2025
eeda15a
chore: Start development of version 0.14 (#2303)
tottoto Jun 18, 2025
bb125a5
chore(build): Make empty client and server modules private (#2291)
ADSteele916 Jun 18, 2025
ca51584
chore(test): Simplify skip debug test (#2305)
tottoto Jun 19, 2025
7d0f3e5
chore(ci): Exclude semver check of unreleased crate (#2304)
tottoto Jun 19, 2025
3d0a9ef
feat(types): Update error_details.proto to a56cbf3b (#2286) (#2306)
kriswuollett Jun 20, 2025
1e6d2e8
chore(test): Remove unnecessary prost-build dependency (#2307)
tottoto Jun 20, 2025
d8977d6
feat(transport): Allow setting TCP_KEEPINTVL and TCP_KEEPCNT (#2299)
xmakro Jun 20, 2025
87d2d4c
fix(tonic): make `Streaming` `Sync` again (#2293)
Twey Jun 20, 2025
e58aec1
feat: preserve user-agent header (#2290)
dbolduc Jun 20, 2025
2d47ef7
chore: Make publish script portable (#2313)
LucioFranco Jun 26, 2025
91be74d
feat(tls): Add tls handshake timeout support (#2309)
honsunrise Jun 28, 2025
2737de3
docs(tonic-build): remove doc-difference between `lib.rs` and Readme …
CommanderStorm Jun 28, 2025
1b2f901
Merge changes from next to master branch (#2315)
dfawley Jul 2, 2025
417fbe9
chore(interop): Update to console 0.16 (#2318)
tottoto Jul 2, 2025
fda1b26
chore(test): Remove unnecessary tokio-stream dependency (#2311)
tottoto Jul 2, 2025
207577c
chore(test): Refactor default stubs test (#2310)
tottoto Jul 2, 2025
23d136e
chore(test): Use tempfile crate to handle temporary file (#2325)
tottoto Jul 3, 2025
cde96ac
chore(grpc): Update to rand 0.9 (#2324)
tottoto Jul 3, 2025
7b6610b
Merge remote-tracking branch 'origin/master' into sync-from-master
dfawley Jul 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
RUSTFLAGS: "-D warnings"
permissions:
contents: read

jobs:

Expand Down Expand Up @@ -69,6 +69,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
Expand All @@ -93,7 +95,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 }}
Expand Down Expand Up @@ -154,18 +156,21 @@ jobs:
- uses: obi1kenobi/cargo-semver-checks-action@v2
with:
feature-group: all-features
exclude: grpc

external-types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-06-30
toolchain: nightly-2025-05-04
- name: Install cargo-check-external-types
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cargo-check-external-types@0.1.13
tool: cargo-check-external-types@0.2.0
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
- run: cargo hack --no-private check-external-types
- run: cargo hack --no-private check-external-types --all-features
env:
RUSTFLAGS: "-D warnings"
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license = "MIT"
edition = "2021"

[dependencies]
protox = "0.8"
protox = "0.9"
prettyplease = "0.2"
quote = "1"
syn = "2"
Expand Down
5 changes: 2 additions & 3 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ default = ["full"]
[dependencies]
# Common dependencies
tokio = { version = "1.0", features = ["rt-multi-thread", "macros"] }
prost = "0.13"
prost = "0.14"
tonic = { path = "../tonic" }
# Optional dependencies
tonic-web = { path = "../tonic-web", optional = true }
Expand All @@ -295,9 +295,8 @@ serde = { version = "1.0", features = ["derive"], optional = true }
serde_json = { version = "1.0", optional = true }
tracing = { version = "0.1.16", optional = true }
tracing-subscriber = { version = "0.3", features = ["tracing-log", "fmt"], optional = true }
prost-types = { version = "0.13", optional = true }
prost-types = { version = "0.14", optional = true }
http = { version = "1", optional = true }
http-body = { version = "1", optional = true }
hyper = { version = "1", optional = true }
hyper-util = { version = "0.1.4", optional = true }
listenfd = { version = "1.0", optional = true }
Expand Down
1 change: 0 additions & 1 deletion examples/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::{env, path::PathBuf};

fn main() {
tonic_build::configure()
.type_attribute("routeguide.Point", "#[derive(Hash)]")
.compile_protos(&["proto/routeguide/route_guide.proto"], &["proto"])
.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion examples/helloworld-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ path = "src/client.rs"

[dependencies]
tonic = "*"
prost = "0.13"
prost = "0.14"
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }

[build-dependencies]
Expand Down
23 changes: 1 addition & 22 deletions examples/routeguide-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Edit `Cargo.toml` and add all the dependencies we'll need for this example:
```toml
[dependencies]
tonic = "*"
prost = "0.13"
prost = "0.14"
tokio = { version = "1.0", features = ["rt-multi-thread", "macros", "sync", "time"] }
tokio-stream = "0.1"

Expand Down Expand Up @@ -335,27 +335,6 @@ the corresponding `data` module to load and deserialize it in
**Note:** If you are following along, you'll need to change the data file's path from
`examples/data/route_guide_db.json` to `data/route_guide_db.json`.

Next, we need to implement `Hash` and `Eq` for `Point`, so we can use point values as map keys:

```rust
use std::hash::{Hasher, Hash};
```

```rust
impl Hash for Point {
fn hash<H>(&self, state: &mut H)
where
H: Hasher,
{
self.latitude.hash(state);
self.longitude.hash(state);
}
}

impl Eq for Point {}

```

Lastly, we need implement two helper functions: `in_range` and `calc_distance`. We'll use them
when performing feature lookups. You can find them in
[examples/src/routeguide/server.rs][in-range-fn].
Expand Down
2 changes: 1 addition & 1 deletion examples/src/authentication/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let response = client.unary_echo(request).await?;

println!("RESPONSE={:?}", response);
println!("RESPONSE={response:?}");

Ok(())
}
2 changes: 1 addition & 1 deletion examples/src/autoreload/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
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));

Expand Down
2 changes: 1 addition & 1 deletion examples/src/blocking/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn main() -> Result<()> {

let response = client.say_hello(request)?;

println!("RESPONSE={:?}", response);
println!("RESPONSE={response:?}");

Ok(())
}
2 changes: 1 addition & 1 deletion examples/src/cancellation/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}
};

println!("RESPONSE={:?}", response);
println!("RESPONSE={response:?}");

Ok(())
}
4 changes: 2 additions & 2 deletions examples/src/cancellation/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -74,7 +74,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
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))
Expand Down
2 changes: 1 addition & 1 deletion examples/src/codec_buffers/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let response = client.say_hello(request).await?;

println!("RESPONSE={:?}", response);
println!("RESPONSE={response:?}");

Ok(())
}
2 changes: 1 addition & 1 deletion examples/src/codec_buffers/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
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))
Expand Down
2 changes: 1 addition & 1 deletion examples/src/compression/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
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)
Expand Down
2 changes: 1 addition & 1 deletion examples/src/dynamic/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

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())
Expand Down
14 changes: 7 additions & 7 deletions examples/src/dynamic_load_balance/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,36 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
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);
});

Expand All @@ -68,7 +68,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

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");
}
Expand Down
2 changes: 1 addition & 1 deletion examples/src/dynamic_load_balance/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

tokio::spawn(async move {
if let Err(e) = serve.await {
eprintln!("Error = {:?}", e);
eprintln!("Error = {e:?}");
}

tx.send(()).unwrap();
Expand Down
6 changes: 3 additions & 3 deletions examples/src/gcp/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.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"]);
Expand All @@ -44,13 +44,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

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(())
}
2 changes: 1 addition & 1 deletion examples/src/grpc-web/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let response = client.say_hello(request).await?;

println!("RESPONSE={:?}", response);
println!("RESPONSE={response:?}");

Ok(())
}
2 changes: 1 addition & 1 deletion examples/src/grpc-web/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.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.
Expand Down
2 changes: 1 addition & 1 deletion examples/src/h2c/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let response = client.say_hello(request).await?;

println!("RESPONSE={:?}", response);
println!("RESPONSE={response:?}");

Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions examples/src/h2c/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
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();
Expand All @@ -57,7 +57,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
});
}
Err(e) => {
eprintln!("Error accepting connection: {}", e);
eprintln!("Error accepting connection: {e}");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/src/health/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
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)
Expand Down
2 changes: 1 addition & 1 deletion examples/src/helloworld/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let response = client.say_hello(request).await?;

println!("RESPONSE={:?}", response);
println!("RESPONSE={response:?}");

Ok(())
}
2 changes: 1 addition & 1 deletion examples/src/helloworld/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
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))
Expand Down
Loading
Loading