(
state: AppState,
udid: String,
source: Option<&str>,
max_depth: Option<usize>,
include_hidden: bool,
interactive_only: bool,
)
| 3310 | } |
| 3311 | |
| 3312 | async 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 | |
| 3343 | async fn refresh_accessibility_tree_value( |
| 3344 | state: AppState, |
no test coverage detected