MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / inspector_session_for_state

Function inspector_session_for_state

packages/server/src/api/routes.rs:3872–3890  ·  view source on GitHub ↗
(
    state: &AppState,
    udid: &str,
)

Source from the content-addressed store, hash-verified

3870}
3871
3872async 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
3892async fn inspector_frontmost_process_identifier(state: &AppState, udid: &str) -> Option<i64> {
3893 if let Ok(Some(process_identifier)) = frontmost_process_identifier(state, udid).await {

Callers 3

accessibility_tree_valueFunction · 0.85
inspector_requestFunction · 0.85

Tested by

no test coverage detected