Repository: build-trust/ockam (Rust)

Issue:
Improve the Readability of Code
### Observed behavior

While working on #7145. I found a minor adjustment that can me made to repo.
[Here](https://github.com/build-trust/ockam/blob/develop/implementations/rust/ockam/ockam_node/src/messages.rs#L201) we can improve naming convention in the code.

Essentially, `read_metadata` is calling `GetMetaData` so having a fn name like `get_metadata` will improve the readability of the code .
This way we can replace `[NodeMessage::ReadMetadata]` with `[NodeMessage::GetMetadata]` so that `cargo doc` doesn't throw unnecessary error. (I have solved it [here](https://github.com/build-trust/ockam/pull/8368/files#diff-f201c22df1178238be8609531a94cc55c6e126b9e1b5263cbf9a61aed6303663L201) )

### Steps to reproduce

Visit [here](https://github.com/build-trust/ockam/blob/develop/implementations/rust/ockam/ockam_node/src/messages.rs#L201)

### Desired behavior

Replace all the occurrence of `read_metadata` with `get_metadata`.

### Ockam Version

v0.130.0


Discussion:

Patch:
diff --git a/implementations/rust/ockam/ockam_api/src/nodes/connection/mod.rs b/implementations/rust/ockam/ockam_api/src/nodes/connection/mod.rs
index 2f6707d6c8c..6d9f167c213 100644
--- a/implementations/rust/ockam/ockam_api/src/nodes/connection/mod.rs
+++ b/implementations/rust/ockam/ockam_api/src/nodes/connection/mod.rs
@@ -307,7 +307,7 @@ impl ConnectionBuilder {
                     // last piece only if it's a terminal (a service connecting to another node)
                     if last_pass && is_last {
                         let is_terminal = ctx
-                            .read_metadata(address.clone())
+                            .get_metadata(address.clone())
                             .await
                             .ok()
                             .flatten()
diff --git a/implementations/rust/ockam/ockam_node/src/context/context.rs b/implementations/rust/ockam/ockam_node/src/context/context.rs
index ac0d941b3e7..b3f1e0d163d 100644
--- a/implementations/rust/ockam/ockam_node/src/context/context.rs
+++ b/implementations/rust/ockam/ockam_node/src/context/context.rs
@@ -233,11 +233,11 @@ impl Context {
     }
 
     /// Read metadata for the provided address
-    pub async fn read_metadata(
+    pub async fn get_metadata(
         &self,
         address: impl Into<Address>,
     ) -> Result<Option<AddressMetadata>> {
-        let (msg, mut reply) = NodeMessage::read_metadata(address.into());
+        let (msg, mut reply) = NodeMessage::get_metadata(address.into());
         self.sender
             .send(msg)
             .await
diff --git a/implementations/rust/ockam/ockam_node/src/messages.rs b/implementations/rust/ockam/ockam_node/src/messages.rs
index 7a62f9df62b..a0cbef00e29 100644
--- a/implementations/rust/ockam/ockam_node/src/messages.rs
+++ b/implementations/rust/ockam/ockam_node/src/messages.rs
@@ -199,7 +199,7 @@ impl NodeMessage {
     }
 
     /// Creates a [NodeMessage::ReadMetadata] message and reply receiver
-    pub fn read_metadata(address: Address) -> (Self, SmallReceiver<NodeReplyResult>) {
+    pub fn get_metadata(address: Address) -> (Self, SmallReceiver<NodeReplyResult>) {
         let (tx, rx) = small_channel();
         (Self::GetMetadata(address, tx), rx)
     }


Test patch:
diff --git a/implementations/rust/ockam/ockam_node/tests/router.rs b/implementations/rust/ockam/ockam_node/tests/router.rs
index 5196b8bd42d..dda11d40c93 100644
--- a/implementations/rust/ockam/ockam_node/tests/router.rs
+++ b/implementations/rust/ockam/ockam_node/tests/router.rs
@@ -94,7 +94,7 @@ async fn provide_and_read_processor_address_metadata(context: &mut Context) -> R
         .start(context)
         .await?;
 
-    let meta = context.read_metadata("processor_address").await?.unwrap();
+    let meta = context.get_metadata("processor_address").await?.unwrap();
 
     assert!(!meta.is_terminal);
 
@@ -106,11 +106,11 @@ async fn provide_and_read_processor_address_metadata(context: &mut Context) -> R
         ]
     );
 
-    assert_eq!(context.read_metadata("non-existing-worker").await?, None);
+    assert_eq!(context.get_metadata("non-existing-worker").await?, None);
 
     context.stop_processor("processor_address").await?;
     ockam_node::compat::tokio::time::sleep(std::time::Duration::from_millis(10)).await;
-    assert_eq!(context.read_metadata("processor_address",).await?, None);
+    assert_eq!(context.get_metadata("processor_address",).await?, None);
 
     context.stop().await
 }
@@ -209,7 +209,7 @@ async fn provide_and_read_address_metadata(context: &mut Context) -> Result<()>
         .start(context)
         .await?;
 
-    let meta = context.read_metadata("worker_address").await?.unwrap();
+    let meta = context.get_metadata("worker_address").await?.unwrap();
 
     assert!(!meta.is_terminal);
 
@@ -221,11 +221,11 @@ async fn provide_and_read_address_metadata(context: &mut Context) -> Result<()>
         ]
     );
 
-    assert_eq!(context.read_metadata("non-existing-worker").await?, None);
+    assert_eq!(context.get_metadata("non-existing-worker").await?, None);
 
     context.stop_worker("worker_address").await?;
     ockam_node::compat::tokio::time::sleep(std::time::Duration::from_millis(10)).await;
-    assert_eq!(context.read_metadata("worker_address").await?, None);
+    assert_eq!(context.get_metadata("worker_address").await?, None);
 
     context.stop().await
 }
@@ -242,7 +242,7 @@ async fn provide_and_read_address_metadata_worker_alias(context: &mut Context) -
         .start(context)
         .await?;
 
-    let meta = context.read_metadata("alias").await?.unwrap();
+    let meta = context.get_metadata("alias").await?.unwrap();
 
     assert!(!meta.is_terminal);
 
@@ -253,7 +253,7 @@ async fn provide_and_read_address_metadata_worker_alias(context: &mut Context) -
 
     context.stop_worker("main").await?;
     ockam_node::compat::tokio::time::sleep(std::time::Duration::from_millis(10)).await;
-    assert_eq!(context.read_metadata("alias").await?, None);
+    assert_eq!(context.get_metadata("alias").await?, None);
 
     context.stop().await
 }