Skip to main content

rustenium_cdp_definitions/browser_protocol/accessibility/
results.rs

1use serde::{Deserialize, Serialize};
2#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3pub struct DisableResult {}
4impl TryFrom<serde_json::Value> for DisableResult {
5    type Error = serde_json::Error;
6    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
7        serde_json::from_value(value)
8    }
9}
10#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
11pub struct EnableResult {}
12impl TryFrom<serde_json::Value> for EnableResult {
13    type Error = serde_json::Error;
14    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
15        serde_json::from_value(value)
16    }
17}
18#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
19pub struct GetPartialAxTreeResult {
20    #[doc = "The `Accessibility.AXNode` for this DOM node, if it exists, plus its ancestors, siblings and\nchildren, if requested."]
21    #[serde(rename = "nodes")]
22    #[serde(skip_serializing_if = "Vec::is_empty")]
23    pub nodes: Vec<super::types::AxNode>,
24}
25impl TryFrom<serde_json::Value> for GetPartialAxTreeResult {
26    type Error = serde_json::Error;
27    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
28        serde_json::from_value(value)
29    }
30}
31#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
32pub struct GetFullAxTreeResult {
33    #[serde(rename = "nodes")]
34    #[serde(skip_serializing_if = "Vec::is_empty")]
35    pub nodes: Vec<super::types::AxNode>,
36}
37impl TryFrom<serde_json::Value> for GetFullAxTreeResult {
38    type Error = serde_json::Error;
39    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
40        serde_json::from_value(value)
41    }
42}
43#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
44pub struct GetRootAxNodeResult {
45    #[serde(rename = "node")]
46    pub node: super::types::AxNode,
47}
48impl TryFrom<serde_json::Value> for GetRootAxNodeResult {
49    type Error = serde_json::Error;
50    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
51        serde_json::from_value(value)
52    }
53}
54#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
55pub struct GetAxNodeAndAncestorsResult {
56    #[serde(rename = "nodes")]
57    #[serde(skip_serializing_if = "Vec::is_empty")]
58    pub nodes: Vec<super::types::AxNode>,
59}
60impl TryFrom<serde_json::Value> for GetAxNodeAndAncestorsResult {
61    type Error = serde_json::Error;
62    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
63        serde_json::from_value(value)
64    }
65}
66#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
67pub struct GetChildAxNodesResult {
68    #[serde(rename = "nodes")]
69    #[serde(skip_serializing_if = "Vec::is_empty")]
70    pub nodes: Vec<super::types::AxNode>,
71}
72impl TryFrom<serde_json::Value> for GetChildAxNodesResult {
73    type Error = serde_json::Error;
74    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
75        serde_json::from_value(value)
76    }
77}
78#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
79pub struct QueryAxTreeResult {
80    #[doc = "A list of `Accessibility.AXNode` matching the specified attributes,\nincluding nodes that are ignored for accessibility."]
81    #[serde(rename = "nodes")]
82    #[serde(skip_serializing_if = "Vec::is_empty")]
83    pub nodes: Vec<super::types::AxNode>,
84}
85impl TryFrom<serde_json::Value> for QueryAxTreeResult {
86    type Error = serde_json::Error;
87    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
88        serde_json::from_value(value)
89    }
90}