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

Function build_sandbox_notes

crates/openshell-core/src/forward.rs:918–929  ·  view source on GitHub ↗

Build notes string for a sandbox based on active forwards. Returns a string like `fwd:8080,3000` or an empty string if no forwards are active for the given sandbox.

(sandbox_name: &str, forwards: &[ForwardInfo])

Source from the content-addressed store, hash-verified

916/// Returns a string like `fwd:8080,3000` or an empty string if no forwards
917/// are active for the given sandbox.
918pub fn build_sandbox_notes(sandbox_name: &str, forwards: &[ForwardInfo]) -> String {
919 let ports: Vec<String> = forwards
920 .iter()
921 .filter(|f| f.sandbox_name == sandbox_name && f.validated_alive)
922 .map(|f| f.port.to_string())
923 .collect();
924 if ports.is_empty() {
925 String::new()
926 } else {
927 format!("fwd:{}", ports.join(","))
928 }
929}
930
931// ---------------------------------------------------------------------------
932// Tests

Callers 1

refresh_sandboxesFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected