From 3b2b0ef70b548bb538646f26005a4461ec52f134 Mon Sep 17 00:00:00 2001 From: Kai Hudalla Date: Fri, 1 Aug 2025 08:55:40 +0200 Subject: [PATCH 1/2] Improve comments explaining usage of LocalTransport --- examples/simple_notify.rs | 4 ++++ examples/simple_publish.rs | 4 ++++ examples/simple_rpc.rs | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/simple_notify.rs b/examples/simple_notify.rs index d5384773..fa4eba70 100644 --- a/examples/simple_notify.rs +++ b/examples/simple_notify.rs @@ -36,6 +36,10 @@ pub async fn main() -> Result<(), Box> { const ORIGIN_RESOURCE_ID: u16 = 0xd100; let uri_provider = Arc::new(StaticUriProvider::new("my-vehicle", 0xa34b, 0x01)); + // using the LocalTransport here allows us to run the client and server in the same process + // without any network communication, which is useful for testing purposes + // in a real application, you would use a transport that employs the network to communicate + // between the client and server, such as the MQTT5 or the Eclipse Zenoh transport let transport = Arc::new(LocalTransport::default()); let notifier = SimpleNotifier::new(transport, uri_provider.clone()); let topic = uri_provider.get_resource_uri(ORIGIN_RESOURCE_ID); diff --git a/examples/simple_publish.rs b/examples/simple_publish.rs index c657e0d3..43f5c06f 100644 --- a/examples/simple_publish.rs +++ b/examples/simple_publish.rs @@ -35,6 +35,10 @@ impl UListener for ConsolePrinter { pub async fn main() -> Result<(), Box> { const ORIGIN_RESOURCE_ID: u16 = 0xb4c1; let uri_provider = Arc::new(StaticUriProvider::new("my-vehicle", 0xa34b, 0x01)); + // using the LocalTransport here allows us to run the client and server in the same process + // without any network communication, which is useful for testing purposes + // in a real application, you would use a transport that employs the network to communicate + // between the client and server, such as the MQTT5 or the Eclipse Zenoh transport let transport = Arc::new(LocalTransport::default()); let publisher = SimplePublisher::new(transport.clone(), uri_provider.clone()); let listener = Arc::new(ConsolePrinter {}); diff --git a/examples/simple_rpc.rs b/examples/simple_rpc.rs index 09169c98..f000ba82 100644 --- a/examples/simple_rpc.rs +++ b/examples/simple_rpc.rs @@ -51,6 +51,10 @@ impl RequestHandler for EchoOperation { pub async fn main() -> Result<(), Box> { const METHOD_RESOURCE_ID: u16 = 0x00a0; let uri_provider = Arc::new(StaticUriProvider::new("my-vehicle", 0xa34b, 0x01)); + // using the LocalTransport here allows us to run the client and server in the same process + // without any network communication, which is useful for testing purposes + // in a real application, you would use a transport that employs the network to communicate + // between the client and server, such as the MQTT5 or the Eclipse Zenoh transport let transport = Arc::new(LocalTransport::default()); // create the RpcServer using the local transport @@ -79,7 +83,7 @@ pub async fn main() -> Result<(), Box> { _ => panic!("expected service to return an Invalid Argument error"), } - // now invoke the operaiton with a message in the request payload + // now invoke the operation with a message in the request payload let value = StringValue { value: "Hello".to_string(), ..Default::default() From 43df5c47e29c6b32adf41c3b2a306ceb898e2520 Mon Sep 17 00:00:00 2001 From: Kai Hudalla Date: Fri, 1 Aug 2025 08:56:58 +0200 Subject: [PATCH 2/2] Bump version to 0.7.0 Also updated up-spec to v1.6.0-alpha.6. --- Cargo.lock | 18 +++++++++--------- Cargo.toml | 4 ++-- README.md | 11 +++++------ src/core/udiscovery.rs | 2 +- src/lib.rs | 20 ++++++++++---------- src/utransport.rs | 8 ++++---- up-spec | 2 +- 7 files changed, 32 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8a9b9472..db27b18a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -156,9 +156,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.40" +version = "4.5.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" +checksum = "ed87a9d530bb41a67537289bafcac159cb3ee28460e0a4571123d2a778a6a882" dependencies = [ "clap_builder", "clap_derive", @@ -166,9 +166,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.40" +version = "4.5.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" +checksum = "64f4f3f3c77c94aff3c7e9aac9a2ca1974a5adf392a8bb751e827d6d127ab966" dependencies = [ "anstream", "anstyle", @@ -179,9 +179,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.40" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" +checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -301,9 +301,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cfac68e08048ae1883171632c2aef3ebc555621ae56fbccce1cbf22dd7f058" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", ] @@ -1526,7 +1526,7 @@ checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" [[package]] name = "up-rust" -version = "0.6.0" +version = "0.7.0" dependencies = [ "async-trait", "bytes", diff --git a/Cargo.toml b/Cargo.toml index 38b24023..3691dc7d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ name = "up-rust" readme = "README.md" repository = "https://github.com/eclipse-uprotocol/up-rust" rust-version = "1.82" -version = "0.6.0" +version = "0.7.0" [features] default = ["communication"] @@ -60,7 +60,7 @@ protobuf-codegen = { version = "3.7.2" } protoc-bin-vendored = { version = "3.1" } [dev-dependencies] -clap = { version = "4.5.40" } +clap = { version = "4.5.42" } cucumber = { version = "0.21.1", features = ["output-junit"] } hex = { version = "0.4.3" } mockall = { version = "0.13.1" } diff --git a/README.md b/README.md index 0ebe77ef..c4dbdd9e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # Eclipse uProtocol Rust library -This is the [uProtocol v1.6.0-alpha.5 Language Library](https://github.com/eclipse-uprotocol/uprotocol-spec/blob/v1.6.0-alpha.5/languages.adoc) for the Rust programming language. +This is the [uProtocol v1.6.0-alpha.6 Language Library](https://github.com/eclipse-uprotocol/uprotocol-spec/blob/v1.6.0-alpha.6/languages.adoc) for the Rust programming language. The crate can be used to -* implement uEntities that communicate with each other using the uProtocol [Communication Layer API](https://github.com/eclipse-uprotocol/up-spec/blob/v1.6.0-alpha.5/up-l2/api.adoc) over one of the supported transport protocols. -* implement support for an additional transport protocol by means of implementing the [Transport Layer API](https://github.com/eclipse-uprotocol/up-spec/blob/v1.6.0-alpha.5/up-l1/README.adoc). +* implement uEntities that communicate with each other using the uProtocol [Communication Layer API](https://github.com/eclipse-uprotocol/up-spec/blob/v1.6.0-alpha.6/up-l2/api.adoc) over one of the supported transport protocols. +* implement support for an additional transport protocol by means of implementing the [Transport Layer API](https://github.com/eclipse-uprotocol/up-spec/blob/v1.6.0-alpha.6/up-l1/README.adoc). ## Using the Crate