Build a JSON object from server configs.
(
servers: &BTreeMap<&str, &McpServerConfig>,
mut server_to_value: F,
)
| 219 | |
| 220 | /// Build a JSON object from server configs. |
| 221 | fn json_map_from_server_refs<F>( |
| 222 | servers: &BTreeMap<&str, &McpServerConfig>, |
| 223 | mut server_to_value: F, |
| 224 | ) -> Map<String, Value> |
| 225 | where |
| 226 | F: FnMut(&McpServerConfig) -> Value, |
| 227 | { |
| 228 | json_map_from_pairs( |
| 229 | servers |
| 230 | .iter() |
| 231 | .map(|(name, config)| ((*name).to_string(), server_to_value(config))), |
| 232 | ) |
| 233 | } |
| 234 | |
| 235 | /// Build a JSON object from existing JSON values. |
| 236 | fn json_map_from_values(values: BTreeMap<String, Value>) -> Map<String, Value> { |
no test coverage detected