From de2a37d203606bffd302206974b3cb54da55949c Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 30 Jul 2024 12:19:57 +0300 Subject: [PATCH] chore: update to http 1.x crates This requires updating prost crates to 0.13.x, tonic to 0.12.x and prost-wkt-* to 0.6.*. Only the examples still pull in http 0.x, due to https://github.com/seanmonstar/warp/pull/1090, but that shouldn't affect consumers of bigtable_rs. Co-Authored-By: Connor Brewster --- bigtable_rs/Cargo.toml | 19 ++++++++++--------- bigtable_rs/src/auth_service.rs | 3 +-- bigtable_rs/src/bigtable.rs | 8 +++++++- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/bigtable_rs/Cargo.toml b/bigtable_rs/Cargo.toml index 522e16c..d344fba 100644 --- a/bigtable_rs/Cargo.toml +++ b/bigtable_rs/Cargo.toml @@ -13,14 +13,15 @@ readme = "../README.md" [dependencies] # tonic, prost, and prost-types are need for build generated rs files -http = "0.2.11" +http = "1.1.0" +hyper-util = { version = "0.1.7", features = ["tokio"] } tokio = { version = "1.25.0", features = ["rt-multi-thread"] } -tonic = { version = "0.11.0", features = ["tls", "transport"] } +tonic = { version = "0.12.1", features = ["tls", "transport"] } tower = { version = "0.4" } -prost = "0.12.2" -prost-types = "0.12.2" -prost-wkt = "0.5.0" -prost-wkt-types = "0.5.0" +prost = "0.13.1" +prost-types = "0.13.1" +prost-wkt = { version = "0.6.0" } +prost-wkt-types = { version = "0.6.0" } serde = { version = "1.0.192", features = ["derive"] } serde_with = { version = "3.4.0", features = ["base64"] } # end of above part @@ -34,6 +35,6 @@ serde_json = "1.0.85" serde_path_to_error = "0.1.8" [build-dependencies] -tonic-build = { version = "0.11.0", features = ["cleanup-markdown"] } -prost-build = "0.12.2" -prost-wkt-build = "0.5.0" +tonic-build = { version = "0.12.1", features = ["cleanup-markdown"] } +prost-build = "0.13.1" +prost-wkt-types = { version = "0.6.0" } diff --git a/bigtable_rs/src/auth_service.rs b/bigtable_rs/src/auth_service.rs index 96fc505..4104949 100644 --- a/bigtable_rs/src/auth_service.rs +++ b/bigtable_rs/src/auth_service.rs @@ -7,7 +7,6 @@ use gcp_auth::TokenProvider; use http::{HeaderValue, Request, Response}; use log::debug; use tonic::body::BoxBody; -use tonic::transport::Body; use tonic::transport::Channel; use tower::Service; @@ -33,7 +32,7 @@ impl AuthSvc { } impl Service> for AuthSvc { - type Response = Response; + type Response = Response; type Error = Box; #[allow(clippy::type_complexity)] type Future = Pin> + Send>>; diff --git a/bigtable_rs/src/bigtable.rs b/bigtable_rs/src/bigtable.rs index 2fdce6e..9fc12ea 100644 --- a/bigtable_rs/src/bigtable.rs +++ b/bigtable_rs/src/bigtable.rs @@ -364,7 +364,13 @@ impl BigTableConnection { let path: String = path.to_string(); let connector = tower::service_fn({ - move |_: tonic::transport::Uri| UnixStream::connect(path.clone()) + move |_: tonic::transport::Uri| { + let path = path.clone(); + async move { + let stream = UnixStream::connect(path).await?; + Ok::<_, std::io::Error>(hyper_util::rt::TokioIo::new(stream)) + } + } }); endpoint.connect_with_connector_lazy(connector)