(
state: &AppState,
udid: &str,
)
| 3870 | } |
| 3871 | |
| 3872 | async fn inspector_session_for_state( |
| 3873 | state: &AppState, |
| 3874 | udid: &str, |
| 3875 | ) -> Result<InspectorSession, String> { |
| 3876 | let frontmost_pid = inspector_frontmost_process_identifier(state, udid).await; |
| 3877 | let connected_error = match connected_inspector_session(state, udid, frontmost_pid).await { |
| 3878 | Ok(session) => return Ok(session), |
| 3879 | Err(error) => error, |
| 3880 | }; |
| 3881 | let registry_error = match registry_inspector_session(state, udid, frontmost_pid).await { |
| 3882 | Ok(session) => return Ok(session), |
| 3883 | Err(error) => error, |
| 3884 | }; |
| 3885 | |
| 3886 | match inspector_session(udid, frontmost_pid).await { |
| 3887 | Ok(session) => Ok(session), |
| 3888 | Err(tcp_error) => Err(format!("{connected_error} {registry_error} {tcp_error}")), |
| 3889 | } |
| 3890 | } |
| 3891 | |
| 3892 | async fn inspector_frontmost_process_identifier(state: &AppState, udid: &str) -> Option<i64> { |
| 3893 | if let Ok(Some(process_identifier)) = frontmost_process_identifier(state, udid).await { |
no test coverage detected