Main application view
| 95 | pub content: TabContent, |
| 96 | pub collection_id: Option<Uuid>, |
| 97 | } |
| 98 | |
| 99 | impl TabState { |
| 100 | pub fn is_environment(&self, id: Uuid) -> bool { |
| 101 | matches!(&self.content, TabContent::Environment { environment_id, .. } if *environment_id == id) |
| 102 | } |
| 103 | |
| 104 | pub fn protocol(&self) -> ProtocolType { |
| 105 | match &self.content { |
| 106 | TabContent::Request { .. } => ProtocolType::Rest, |
| 107 | TabContent::WebSocket { .. } => ProtocolType::WebSocket, |
| 108 | TabContent::Environment { .. } => ProtocolType::Rest, |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | #[allow(dead_code)] |
| 113 | pub fn environment_id(&self) -> Option<Uuid> { |
| 114 | match &self.content { |
| 115 | TabContent::Environment { environment_id, .. } => Some(*environment_id), |
| 116 | _ => None, |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | #[allow(dead_code)] |
| 121 | pub fn environment_view(&self) -> Option<&Entity<EnvironmentView>> { |
| 122 | match &self.content { |
| 123 | TabContent::Environment { view, .. } => Some(view), |
| 124 | _ => None, |
| 125 | } |
| 126 | } |
nothing calls this directly
no outgoing calls
no test coverage detected