From 2b949617b2660170c99b9f597df7274f8e09ad9d Mon Sep 17 00:00:00 2001 From: yangyang <962032265@qq.com> Date: Mon, 8 Jul 2024 19:15:38 +0800 Subject: [PATCH] chore: Release --- dubbo-build/Cargo.toml | 2 +- dubbo/Cargo.toml | 2 +- examples/echo/Cargo.toml | 2 +- .../echo/src/generated/grpc.examples.echo.rs | 127 +++++++++++++----- examples/greeter/Cargo.toml | 2 +- registry/nacos/Cargo.toml | 2 +- registry/zookeeper/Cargo.toml | 2 +- 7 files changed, 96 insertions(+), 43 deletions(-) diff --git a/dubbo-build/Cargo.toml b/dubbo-build/Cargo.toml index 1ca031da..4284bc67 100644 --- a/dubbo-build/Cargo.toml +++ b/dubbo-build/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dubbo-build" -version = "0.3.0" +version = "0.4.0" edition = "2021" license = "Apache-2.0" description = "dubbo-build" diff --git a/dubbo/Cargo.toml b/dubbo/Cargo.toml index d5b9a1e8..65dada00 100644 --- a/dubbo/Cargo.toml +++ b/dubbo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dubbo" -version = "0.3.0" +version = "0.4.0" edition = "2021" license = "Apache-2.0" description = "dubbo" diff --git a/examples/echo/Cargo.toml b/examples/echo/Cargo.toml index 2d64a2a0..7d090479 100644 --- a/examples/echo/Cargo.toml +++ b/examples/echo/Cargo.toml @@ -44,4 +44,4 @@ dubbo = {path = "../../dubbo"} dubbo-registry-zookeeper = {path="../../registry/zookeeper"} [build-dependencies] -dubbo-build = {path = "../../dubbo-build", version = "0.3.0" } +dubbo-build = {path = "../../dubbo-build", version = "0.4.0" } diff --git a/examples/echo/src/generated/grpc.examples.echo.rs b/examples/echo/src/generated/grpc.examples.echo.rs index fc48dc5c..ee8cc1e6 100644 --- a/examples/echo/src/generated/grpc.examples.echo.rs +++ b/examples/echo/src/generated/grpc.examples.echo.rs @@ -43,7 +43,9 @@ pub mod echo_client { let invocation = RpcInvocation::default() .with_service_unique_name(String::from("grpc.examples.echo.Echo")) .with_method_name(String::from("UnaryEcho")); - let path = http::uri::PathAndQuery::from_static("/grpc.examples.echo.Echo/UnaryEcho"); + let path = http::uri::PathAndQuery::from_static( + "/grpc.examples.echo.Echo/UnaryEcho", + ); self.inner.unary(request, path, invocation).await } /// ServerStreamingEcho is server side streaming. @@ -100,7 +102,9 @@ pub mod echo_server { request: Request, ) -> Result, dubbo::status::Status>; ///Server streaming response type for the ServerStreamingEcho method. - type ServerStreamingEchoStream: futures_util::Stream> + type ServerStreamingEchoStream: futures_util::Stream< + Item = Result, + > + Send + 'static; /// ServerStreamingEcho is server side streaming. @@ -114,14 +118,19 @@ pub mod echo_server { request: Request>, ) -> Result, dubbo::status::Status>; ///Server streaming response type for the BidirectionalStreamingEcho method. - type BidirectionalStreamingEchoStream: futures_util::Stream> + type BidirectionalStreamingEchoStream: futures_util::Stream< + Item = Result, + > + Send + 'static; /// BidirectionalStreamingEcho is bidi streaming. async fn bidirectional_streaming_echo( &self, request: Request>, - ) -> Result, dubbo::status::Status>; + ) -> Result< + Response, + dubbo::status::Status, + >; } /// Echo is the echo service. #[derive(Debug)] @@ -151,7 +160,10 @@ pub mod echo_server { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { @@ -164,16 +176,24 @@ pub mod echo_server { } impl UnarySvc for UnaryEchoServer { type Response = super::EchoResponse; - type Future = BoxFuture, dubbo::status::Status>; - fn call(&mut self, request: Request) -> Self::Future { + type Future = BoxFuture< + Response, + dubbo::status::Status, + >; + fn call( + &mut self, + request: Request, + ) -> Self::Future { let inner = self.inner.0.clone(); let fut = async move { inner.unary_echo(request).await }; Box::pin(fut) } } let fut = async move { - let mut server = - TripleServer::::new(); + let mut server = TripleServer::< + super::EchoRequest, + super::EchoResponse, + >::new(); let res = server.unary(UnaryEchoServer { inner }, req).await; Ok(res) }; @@ -184,20 +204,30 @@ pub mod echo_server { struct ServerStreamingEchoServer { inner: _Inner, } - impl ServerStreamingSvc for ServerStreamingEchoServer { + impl ServerStreamingSvc + for ServerStreamingEchoServer { type Response = super::EchoResponse; type ResponseStream = T::ServerStreamingEchoStream; - type Future = - BoxFuture, dubbo::status::Status>; - fn call(&mut self, request: Request) -> Self::Future { + type Future = BoxFuture< + Response, + dubbo::status::Status, + >; + fn call( + &mut self, + request: Request, + ) -> Self::Future { let inner = self.inner.0.clone(); - let fut = async move { inner.server_streaming_echo(request).await }; + let fut = async move { + inner.server_streaming_echo(request).await + }; Box::pin(fut) } } let fut = async move { - let mut server = - TripleServer::::new(); + let mut server = TripleServer::< + super::EchoRequest, + super::EchoResponse, + >::new(); let res = server .server_streaming(ServerStreamingEchoServer { inner }, req) .await; @@ -210,21 +240,29 @@ pub mod echo_server { struct ClientStreamingEchoServer { inner: _Inner, } - impl ClientStreamingSvc for ClientStreamingEchoServer { + impl ClientStreamingSvc + for ClientStreamingEchoServer { type Response = super::EchoResponse; - type Future = BoxFuture, dubbo::status::Status>; + type Future = BoxFuture< + Response, + dubbo::status::Status, + >; fn call( &mut self, request: Request>, ) -> Self::Future { let inner = self.inner.0.clone(); - let fut = async move { inner.client_streaming_echo(request).await }; + let fut = async move { + inner.client_streaming_echo(request).await + }; Box::pin(fut) } } let fut = async move { - let mut server = - TripleServer::::new(); + let mut server = TripleServer::< + super::EchoRequest, + super::EchoResponse, + >::new(); let res = server .client_streaming(ClientStreamingEchoServer { inner }, req) .await; @@ -237,39 +275,54 @@ pub mod echo_server { struct BidirectionalStreamingEchoServer { inner: _Inner, } - impl StreamingSvc for BidirectionalStreamingEchoServer { + impl StreamingSvc + for BidirectionalStreamingEchoServer { type Response = super::EchoResponse; type ResponseStream = T::BidirectionalStreamingEchoStream; - type Future = - BoxFuture, dubbo::status::Status>; + type Future = BoxFuture< + Response, + dubbo::status::Status, + >; fn call( &mut self, request: Request>, ) -> Self::Future { let inner = self.inner.0.clone(); - let fut = - async move { inner.bidirectional_streaming_echo(request).await }; + let fut = async move { + inner.bidirectional_streaming_echo(request).await + }; Box::pin(fut) } } let fut = async move { - let mut server = - TripleServer::::new(); + let mut server = TripleServer::< + super::EchoRequest, + super::EchoResponse, + >::new(); let res = server - .bidi_streaming(BidirectionalStreamingEchoServer { inner }, req) + .bidi_streaming( + BidirectionalStreamingEchoServer { + inner, + }, + req, + ) .await; Ok(res) }; Box::pin(fut) } - _ => Box::pin(async move { - Ok(http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap()) - }), + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } } } } diff --git a/examples/greeter/Cargo.toml b/examples/greeter/Cargo.toml index a75b0385..ec4f0cda 100644 --- a/examples/greeter/Cargo.toml +++ b/examples/greeter/Cargo.toml @@ -36,4 +36,4 @@ dubbo-registry-zookeeper = {path="../../registry/zookeeper"} dubbo-registry-nacos = {path="../../registry/nacos"} [build-dependencies] -dubbo-build = { path = "../../dubbo-build", version = "0.3.0" } +dubbo-build = { path = "../../dubbo-build", version = "0.4.0" } diff --git a/registry/nacos/Cargo.toml b/registry/nacos/Cargo.toml index 7d63ca7b..54530beb 100644 --- a/registry/nacos/Cargo.toml +++ b/registry/nacos/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dubbo-registry-nacos" -version = "0.3.0" +version = "0.4.0" edition = "2021" license = "Apache-2.0" description = "dubbo-rust-registry-nacos" diff --git a/registry/zookeeper/Cargo.toml b/registry/zookeeper/Cargo.toml index 484ea04a..5ddf86a6 100644 --- a/registry/zookeeper/Cargo.toml +++ b/registry/zookeeper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dubbo-registry-zookeeper" -version = "0.3.0" +version = "0.4.0" edition = "2021" license = "Apache-2.0" description = "dubbo-rust-registry-zookeeper"