MCPcopy Create free account
hub / github.com/apache/skywalking-php / get_peer

Function get_peer

src/plugin/plugin_mongodb.rs:173–191  ·  view source on GitHub ↗
(this: &mut ZObj)

Source from the content-addressed store, hash-verified

171}
172
173fn get_peer(this: &mut ZObj) -> phper::Result<String> {
174 let mut addr = Vec::new();
175
176 let mut servers = this.call("getServers", [])?;
177 let servers = servers.expect_mut_z_arr()?;
178
179 for (_, server) in servers.iter_mut() {
180 let server = server.expect_mut_z_obj()?;
181
182 let host = server.call("getHost", [])?;
183 let host = host.expect_z_str()?.to_str()?;
184
185 let port = server.call("getPort", [])?.expect_long()?;
186
187 addr.push(format!("{}:{}", host, port));
188 }
189
190 Ok(addr.join(";"))
191}

Callers 3

after_manager_crud_hookFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected