MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / format_endpoint_summary

Function format_endpoint_summary

crates/openshell-tui/src/ui/sandbox_draft.rs:535–556  ·  view source on GitHub ↗
(endpoint: &NetworkEndpoint)

Source from the content-addressed store, hash-verified

533}
534
535fn format_endpoint_summary(endpoint: &NetworkEndpoint) -> String {
536 let host_port = if endpoint.port > 0 {
537 format!("{}:{}", endpoint.host, endpoint.port)
538 } else {
539 endpoint.host.clone()
540 };
541
542 let mut tags = vec![endpoint_layer_label(endpoint).to_string()];
543 if !endpoint.access.is_empty() {
544 tags.push(format!("access={}", endpoint.access));
545 }
546 for rule in &endpoint.rules {
547 if let Some(allow) = &rule.allow {
548 tags.push(format!("allow {}", format_allow_rule(allow)));
549 }
550 }
551 for deny in &endpoint.deny_rules {
552 tags.push(format!("deny {}", format_deny_rule(deny)));
553 }
554
555 format!("{host_port} [{}]", tags.join(", "))
556}
557
558fn format_endpoint_details(endpoint: &NetworkEndpoint) -> Vec<String> {
559 let mut details = Vec::new();

Callers

nothing calls this directly

Calls 2

pushMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected