From 7e6bb514b92f44a20ffc07cd0f0acee4479e0302 Mon Sep 17 00:00:00 2001 From: hubertshelley Date: Tue, 9 Jul 2024 17:16:42 +0800 Subject: [PATCH] publish: v1.4.0 --- Cargo.toml | 2 +- examples/grpc_h2c/Cargo.toml | 4 ++++ silent/Cargo.toml | 2 +- silent/src/route/root.rs | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9bf3b30..95bfde1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,4 +10,4 @@ homepage = "https://github.com/hubertshelley/silent" license = "Apache-2.0" readme = "./readme.md" repository = "https://github.com/hubertshelley/silent" -version = "1.3.4" +version = "1.4.0" diff --git a/examples/grpc_h2c/Cargo.toml b/examples/grpc_h2c/Cargo.toml index e0ab7f4..5343d1e 100644 --- a/examples/grpc_h2c/Cargo.toml +++ b/examples/grpc_h2c/Cargo.toml @@ -18,6 +18,10 @@ prost = "0.13" tokio = { version = "1.38", features = ["macros", "rt-multi-thread"] } silent = { path = "../../silent", features = ["grpc"] } async-trait = "0.1.81" +http = "1.1.0" +hyper-util = "0.1.6" +hyper = "1.4.0" +tower = "0.4.13" [build-dependencies] tonic-build = { version = "0.12.0" } diff --git a/silent/Cargo.toml b/silent/Cargo.toml index 6b04012..462cd97 100644 --- a/silent/Cargo.toml +++ b/silent/Cargo.toml @@ -41,7 +41,7 @@ tokio = { version = "1.38.0", optional = true } bytes = "1.6.0" http-body-util = "0.1.2" tracing = "0.1.40" -tracing-subscriber = { version = "0.3.18", features = ["local-time"] } +tracing-subscriber = { version = "0.3.18", features = ["chrono"] } async-trait = "0.1.81" serde = { version = "1.0.204", features = ["derive"] } serde_json = "1.0.120" diff --git a/silent/src/route/root.rs b/silent/src/route/root.rs index 47926a2..1eb6271 100644 --- a/silent/src/route/root.rs +++ b/silent/src/route/root.rs @@ -17,6 +17,7 @@ use crate::{ #[cfg(feature = "session")] use async_session::{Session, SessionStore}; use chrono::Utc; +#[cfg(feature = "grpc")] use http::Method; use std::fmt; use std::future::Future; @@ -24,8 +25,11 @@ use std::net::SocketAddr; use std::sync::Arc; #[cfg(feature = "scheduler")] use tokio::sync::Mutex; +#[cfg(feature = "grpc")] use tonic::body::BoxBody; +#[cfg(feature = "grpc")] use tonic::codegen::Service; +#[cfg(feature = "grpc")] use tonic::server::NamedService; #[derive(Clone, Default)]