Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles-Schleich committed Dec 9, 2024
1 parent d7b5d1b commit 0f321f4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
15 changes: 11 additions & 4 deletions zenoh-plugin-remote-api/src/handle_control_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,24 @@ 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<String> = session_info.peers_zid().await.map(|x|x.to_string()).collect();
let z_routers: Vec<String> = session_info.routers_zid().await.map(|x|x.to_string()).collect();
let z_peers: Vec<String> = session_info
.peers_zid()
.await
.map(|x| x.to_string())
.collect();
let z_routers: Vec<String> = session_info
.routers_zid()
.await
.map(|x| x.to_string())
.collect();

let session_info = SessionInfo {
zid,
z_routers,
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}");
Expand Down
10 changes: 5 additions & 5 deletions zenoh-plugin-remote-api/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub enum DataMsg {
Sample(SampleWS, Uuid),
// GetReply
GetReply(ReplyWS),
//
//
SessionInfo(SessionInfo),

// Bidirectional
Expand All @@ -82,9 +82,9 @@ pub enum DataMsg {
#[ts(export)]
#[derive(Debug, Serialize, Deserialize)]
pub struct SessionInfo {
pub zid: String,
pub z_routers:Vec<String>,
pub z_peers:Vec<String>,
pub zid: String,
pub z_routers: Vec<String>,
pub z_peers: Vec<String>,
}

#[derive(TS)]
Expand Down Expand Up @@ -117,7 +117,7 @@ pub enum ControlMsg {
CloseSession,
Session(Uuid),

//
//
SessionInfo,

// Session Action Messages
Expand Down

0 comments on commit 0f321f4

Please sign in to comment.