(
state: AppState,
udid: String,
source: Option<&str>,
max_depth: Option<usize>,
include_hidden: bool,
interactive_only: bool,
)
| 3341 | } |
| 3342 | |
| 3343 | async fn refresh_accessibility_tree_value( |
| 3344 | state: AppState, |
| 3345 | udid: String, |
| 3346 | source: Option<&str>, |
| 3347 | max_depth: Option<usize>, |
| 3348 | include_hidden: bool, |
| 3349 | interactive_only: bool, |
| 3350 | ) -> Result<Value, AppError> { |
| 3351 | let cache_key = |
| 3352 | accessibility_cache_key(&udid, source, max_depth, include_hidden, interactive_only); |
| 3353 | let generation = state.accessibility_cache.generation(&udid); |
| 3354 | let snapshot = accessibility_tree_value( |
| 3355 | state.clone(), |
| 3356 | udid.clone(), |
| 3357 | source, |
| 3358 | max_depth, |
| 3359 | include_hidden, |
| 3360 | interactive_only, |
| 3361 | ) |
| 3362 | .await?; |
| 3363 | if let Some(cache_key) = cache_key { |
| 3364 | state |
| 3365 | .accessibility_cache |
| 3366 | .insert_if_generation(cache_key, &snapshot, generation); |
| 3367 | } |
| 3368 | Ok(snapshot) |
| 3369 | } |
| 3370 | |
| 3371 | fn accessibility_cache_key( |
| 3372 | udid: &str, |
no test coverage detected