From 0f321f4e37dd6bfce627ff9f7b4e26c0038f8961 Mon Sep 17 00:00:00 2001 From: Charles Schleich Date: Mon, 9 Dec 2024 10:16:20 +0100 Subject: [PATCH] fmt --- .../src/handle_control_message.rs | 15 +++++++++++---- zenoh-plugin-remote-api/src/interface.rs | 10 +++++----- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/zenoh-plugin-remote-api/src/handle_control_message.rs b/zenoh-plugin-remote-api/src/handle_control_message.rs index 7765575..b7c1c68 100644 --- a/zenoh-plugin-remote-api/src/handle_control_message.rs +++ b/zenoh-plugin-remote-api/src/handle_control_message.rs @@ -73,8 +73,16 @@ pub(crate) async fn handle_control_message( let session_info = state_map.session.info(); let zid = session_info.zid().await.to_string(); - let z_peers: Vec = session_info.peers_zid().await.map(|x|x.to_string()).collect(); - let z_routers: Vec = session_info.routers_zid().await.map(|x|x.to_string()).collect(); + let z_peers: Vec = session_info + .peers_zid() + .await + .map(|x| x.to_string()) + .collect(); + let z_routers: Vec = session_info + .routers_zid() + .await + .map(|x| x.to_string()) + .collect(); let session_info = SessionInfo { zid, @@ -82,8 +90,7 @@ pub(crate) async fn handle_control_message( z_peers, }; - let remote_api_message = - RemoteAPIMsg::Data(DataMsg::SessionInfo(session_info)); + let remote_api_message = RemoteAPIMsg::Data(DataMsg::SessionInfo(session_info)); if let Err(e) = state_map.websocket_tx.send(remote_api_message) { error!("Forward Sample Channel error: {e}"); diff --git a/zenoh-plugin-remote-api/src/interface.rs b/zenoh-plugin-remote-api/src/interface.rs index bc18216..0f99cc1 100644 --- a/zenoh-plugin-remote-api/src/interface.rs +++ b/zenoh-plugin-remote-api/src/interface.rs @@ -71,7 +71,7 @@ pub enum DataMsg { Sample(SampleWS, Uuid), // GetReply GetReply(ReplyWS), - // + // SessionInfo(SessionInfo), // Bidirectional @@ -82,9 +82,9 @@ pub enum DataMsg { #[ts(export)] #[derive(Debug, Serialize, Deserialize)] pub struct SessionInfo { - pub zid: String, - pub z_routers:Vec, - pub z_peers:Vec, + pub zid: String, + pub z_routers: Vec, + pub z_peers: Vec, } #[derive(TS)] @@ -117,7 +117,7 @@ pub enum ControlMsg { CloseSession, Session(Uuid), - // + // SessionInfo, // Session Action Messages