pub struct PortForwardSession { pub id: String, pub cluster_id: String, pub namespace: String, pub pod: String, pub container: Option, pub ports: Vec, pub local_ports: Vec, pub status: PortForwardStatus, } pub enum PortForwardStatus { Active, Stopped, Error(String), } impl PortForwardSession { pub fn new( id: String, cluster_id: String, namespace: String, pod: String, container: Option, ports: Vec, local_ports: Vec, ) -> Self { Self { id, cluster_id, namespace, pod, container, ports, local_ports, status: PortForwardStatus::Active, } } pub fn stop(&mut self) { self.status = PortForwardStatus::Stopped; } pub fn is_active(&self) -> bool { matches!(self.status, PortForwardStatus::Active) } }