From adb554d8dbce15dc000615a762725cd86fcf8283 Mon Sep 17 00:00:00 2001 From: Daniel Krippner Date: Fri, 5 Apr 2024 16:15:10 +0200 Subject: [PATCH 1/3] Make Utransport-related traits async-usable --- src/rpc/rpcclient.rs | 2 +- src/utransport.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/rpcclient.rs b/src/rpc/rpcclient.rs index f66c64d9..4bff867d 100644 --- a/src/rpc/rpcclient.rs +++ b/src/rpc/rpcclient.rs @@ -23,7 +23,7 @@ pub type RpcClientResult = Result; /// The trait provides a clean contract for mapping a RPC requiest to a response. For more details please refer to the /// [RpcClient Specifications](https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/up-l2/README.adoc). #[async_trait] -pub trait RpcClient { +pub trait RpcClient: Send + Sync { /// Invokes a method on a remote service asynchronously. /// /// This function is an API for clients to send an RPC request and receive a response. diff --git a/src/utransport.rs b/src/utransport.rs index 8814e1a2..c0c76d80 100644 --- a/src/utransport.rs +++ b/src/utransport.rs @@ -130,7 +130,7 @@ pub trait UListener: 'static + Send + Sync { /// sending [`UMessage`][crate::UMessage] using the configured technology. For more information, please refer to /// [uProtocol Specification](https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/up-l1/README.adoc). #[async_trait] -pub trait UTransport { +pub trait UTransport: Send + Sync { /// Sends a message using this transport's message exchange mechanism. /// /// # Arguments From f51031ea53d6d6bc0258b0bbf1e37f67084b849f Mon Sep 17 00:00:00 2001 From: Daniel Krippner Date: Fri, 5 Apr 2024 16:19:31 +0200 Subject: [PATCH 2/3] UListener doesn't need to be 'static --- src/utransport.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utransport.rs b/src/utransport.rs index c0c76d80..346d1a46 100644 --- a/src/utransport.rs +++ b/src/utransport.rs @@ -86,7 +86,7 @@ use crate::{UMessage, UStatus, UUri}; /// } /// ``` #[async_trait] -pub trait UListener: 'static + Send + Sync { +pub trait UListener: Send + Sync { /// Performs some action on receipt of a message /// /// # Parameters From 42beda850c31511c92fdb21e7d4095b6a2c0689f Mon Sep 17 00:00:00 2001 From: Daniel Krippner Date: Fri, 5 Apr 2024 16:27:06 +0200 Subject: [PATCH 3/3] Fix documentation ref urls --- src/rpc/rpcclient.rs | 4 ++-- src/utransport.rs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/rpc/rpcclient.rs b/src/rpc/rpcclient.rs index 4bff867d..6da9751c 100644 --- a/src/rpc/rpcclient.rs +++ b/src/rpc/rpcclient.rs @@ -18,10 +18,10 @@ use crate::{CallOptions, RpcMapperError, UMessage, UPayload, UUri}; pub type RpcClientResult = Result; /// `RpcClient` is an interface used by code generators for uProtocol services defined in `.proto` files such as -/// the core uProtocol services found in [uProtocol Core API](https://github.com/eclipse-uprotocol/uprotocol-core-api). +/// the core uProtocol services found in [uProtocol Core API](https://github.com/eclipse-uprotocol/up-spec/tree/main/up-core-api). /// /// The trait provides a clean contract for mapping a RPC requiest to a response. For more details please refer to the -/// [RpcClient Specifications](https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/up-l2/README.adoc). +/// [RpcClient Specifications](https://github.com/eclipse-uprotocol/up-spec/blob/main/up-l2/rpcclient.adoc). #[async_trait] pub trait RpcClient: Send + Sync { /// Invokes a method on a remote service asynchronously. diff --git a/src/utransport.rs b/src/utransport.rs index 346d1a46..fec2d87e 100644 --- a/src/utransport.rs +++ b/src/utransport.rs @@ -22,8 +22,7 @@ use crate::{UMessage, UStatus, UUri}; /// /// Implementations of `UListener` contain the details for what should occur when a message is received /// -/// For more information, please refer to -/// [uProtocol Specification](https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/up-l1/README.adoc). +/// For more information, please refer to [uProtocol Specification](https://github.com/eclipse-uprotocol/up-spec/blob/main/up-l1/README.adoc). /// /// # Examples /// @@ -128,7 +127,7 @@ pub trait UListener: Send + Sync { /// /// Implementations of [`UTransport`] contain the details for connecting to the underlying transport technology and /// sending [`UMessage`][crate::UMessage] using the configured technology. For more information, please refer to -/// [uProtocol Specification](https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/up-l1/README.adoc). +/// [uProtocol Specification](https://github.com/eclipse-uprotocol/up-spec/blob/main/up-l1/README.adoc). #[async_trait] pub trait UTransport: Send + Sync { /// Sends a message using this transport's message exchange mechanism.