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

Function cached_accessibility_tree_value

packages/server/src/api/routes.rs:3312–3341  ·  view source on GitHub ↗
(
    state: AppState,
    udid: String,
    source: Option<&str>,
    max_depth: Option<usize>,
    include_hidden: bool,
    interactive_only: bool,
)

Source from the content-addressed store, hash-verified

3310}
3311
3312async fn cached_accessibility_tree_value(
3313 state: AppState,
3314 udid: String,
3315 source: Option<&str>,
3316 max_depth: Option<usize>,
3317 include_hidden: bool,
3318 interactive_only: bool,
3319) -> Result<Value, AppError> {
3320 let cache_key =
3321 accessibility_cache_key(&udid, source, max_depth, include_hidden, interactive_only);
3322 if let Some(cache_key) = cache_key.as_ref() {
3323 if let Some((cached_key, snapshot)) = state.accessibility_cache.get_compatible(cache_key) {
3324 return Ok(if cached_key.max_depth != cache_key.max_depth {
3325 trim_tree_depth(snapshot, cache_key.max_depth)
3326 } else {
3327 snapshot
3328 });
3329 }
3330 }
3331
3332 refresh_accessibility_tree_value(
3333 state,
3334 udid,
3335 source,
3336 max_depth,
3337 include_hidden,
3338 interactive_only,
3339 )
3340 .await
3341}
3342
3343async fn refresh_accessibility_tree_value(
3344 state: AppState,

Callers 6

perform_tap_payloadFunction · 0.85
query_element_payloadFunction · 0.85
wait_for_snapshot_matchFunction · 0.85
run_batch_stepFunction · 0.85
accessibility_treeFunction · 0.85

Calls 4

accessibility_cache_keyFunction · 0.85
trim_tree_depthFunction · 0.85
get_compatibleMethod · 0.80

Tested by

no test coverage detected