From d576ee166920fe0b98e21e71b2a9c20fc3d313c4 Mon Sep 17 00:00:00 2001 From: Eliad Peller Date: Tue, 10 Sep 2024 13:51:20 +0300 Subject: [PATCH] update dependencies move to tonic 0.12 Signed-off-by: Eliad Peller --- Cargo.toml | 11 ++++++----- src/lib.rs | 7 +++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 05f9240..2a84bc2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,15 +12,16 @@ documentation = "https://docs.rs/crate/k8s-cri" readme = "README.md" [dependencies] -tonic = { version = "0.11"} -prost = "0.12" +tonic = { version = "0.12"} +prost = "0.13" serde = { version = "1.0", features = ["derive"] } [build-dependencies.tonic-build] -version = "0.11" +version = "0.12" default-features = false features = ["prost", "transport"] [dev-dependencies] -tokio = { version = "1.37", features = [ "rt-multi-thread", "macros" ] } -tower = "0.4" +tokio = { version = "1.40", features = [ "rt-multi-thread", "macros" ] } +tower = { version = "0.5", features = ["util"] } +hyper-util = "0.1" diff --git a/src/lib.rs b/src/lib.rs index 2284360..da997c1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -34,13 +34,16 @@ //! use tokio::net::UnixStream; //! use tonic::transport::{Channel, Endpoint, Uri}; //! use tower::service_fn; +//! use hyper_util::rt::TokioIo; //! //! #[tokio::main] //! async fn main() { -//! let path = "/run/containerd/containerd.sock"; //! let channel = Endpoint::try_from("http://[::]") //! .unwrap() -//! .connect_with_connector(service_fn(move |_: Uri| UnixStream::connect(path))) +//! .connect_with_connector(service_fn(|_: Uri| async { +//! let path = "/run/containerd/containerd.sock"; +//! Ok::<_, std::io::Error>(TokioIo::new(UnixStream::connect(path).await?)) +//! })) //! .await //! .expect("Could not create client."); //!