(
app_state: &AppState,
raw_path: &str,
preferred_remote_connection_id: Option<&str>,
)
| 126 | } |
| 127 | |
| 128 | pub async fn resolve_desktop_path_target( |
| 129 | app_state: &AppState, |
| 130 | raw_path: &str, |
| 131 | preferred_remote_connection_id: Option<&str>, |
| 132 | ) -> Result<DesktopPathTarget, String> { |
| 133 | if let Some(resolved_path) = resolve_runtime_artifact_path(app_state, raw_path).await? { |
| 134 | return Ok(DesktopPathTarget::Local { |
| 135 | requested_path: raw_path.to_string(), |
| 136 | resolved_path, |
| 137 | is_runtime_artifact: true, |
| 138 | }); |
| 139 | } |
| 140 | |
| 141 | if let Some(entry) = |
| 142 | lookup_remote_entry_for_path(app_state, raw_path, preferred_remote_connection_id).await |
| 143 | { |
| 144 | return Ok(DesktopPathTarget::Remote { |
| 145 | requested_path: raw_path.to_string(), |
| 146 | entry, |
| 147 | }); |
| 148 | } |
| 149 | |
| 150 | Ok(DesktopPathTarget::Local { |
| 151 | requested_path: raw_path.to_string(), |
| 152 | resolved_path: PathBuf::from(raw_path), |
| 153 | is_runtime_artifact: false, |
| 154 | }) |
| 155 | } |
| 156 | |
| 157 | #[derive(Debug, Clone, Serialize)] |
| 158 | #[serde(rename_all = "camelCase")] |
no test coverage detected