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

Function print_describe_ui

packages/server/src/main/accessibility_format.rs:1–16  ·  view source on GitHub ↗
(snapshot: &Value, format: DescribeUiFormat)

Source from the content-addressed store, hash-verified

1fn print_describe_ui(snapshot: &Value, format: DescribeUiFormat) -> anyhow::Result<()> {
2 match format {
3 DescribeUiFormat::Json => println_json(snapshot),
4 DescribeUiFormat::CompactJson => {
5 println!(
6 "{}",
7 serde_json::to_string(&compact_accessibility_snapshot(snapshot))?
8 );
9 Ok(())
10 }
11 DescribeUiFormat::Agent => {
12 print!("{}", render_agent_accessibility_tree(snapshot));
13 Ok(())
14 }
15 }
16}
17
18fn compact_accessibility_snapshot(snapshot: &Value) -> Value {
19 let roots = snapshot

Callers 1

mainFunction · 0.85

Calls 1

println_jsonFunction · 0.85

Tested by

no test coverage detected