Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Utransport-related traits async-usable #79

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/rpc/rpcclient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ use crate::{CallOptions, RpcMapperError, UMessage, UPayload, UUri};
pub type RpcClientResult = Result<UMessage, RpcMapperError>;

/// `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 {
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.
Expand Down
9 changes: 4 additions & 5 deletions src/utransport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down Expand Up @@ -86,7 +85,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
Expand Down Expand Up @@ -128,9 +127,9 @@ pub trait UListener: 'static + 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 {
pub trait UTransport: Send + Sync {
/// Sends a message using this transport's message exchange mechanism.
///
/// # Arguments
Expand Down