#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct DisableParams {}
impl<'de> serde::Deserialize<'de> for DisableParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DisableParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(DisableParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct Disable;
#[derive(Debug, Clone, serde::Serialize)]
pub struct DisableResponse {}
impl<'de> serde::Deserialize<'de> for DisableResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DisableResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(DisableResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for Disable {
type Params = DisableParams;
type Response = DisableResponse;
const METHOD: &'static str = "Accessibility.disable";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct EnableParams {}
impl<'de> serde::Deserialize<'de> for EnableParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EnableParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(EnableParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct Enable;
#[derive(Debug, Clone, serde::Serialize)]
pub struct EnableResponse {}
impl<'de> serde::Deserialize<'de> for EnableResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EnableResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(EnableResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for Enable {
type Params = EnableParams;
type Response = EnableResponse;
const METHOD: &'static str = "Accessibility.enable";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct GetAxNodeAndAncestorsParams {
#[serde(rename = "nodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub node_id: Option<crate::dom::types::NodeId>,
#[serde(rename = "backendNodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub backend_node_id: Option<crate::dom::types::BackendNodeId>,
#[serde(rename = "objectId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub object_id: Option<crate::runtime::types::RemoteObjectId>,
}
impl<'de> serde::Deserialize<'de> for GetAxNodeAndAncestorsParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetAxNodeAndAncestorsParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "nodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub node_id: Option<crate::dom::types::NodeId>,
#[serde(rename = "backendNodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub backend_node_id: Option<crate::dom::types::BackendNodeId>,
#[serde(rename = "objectId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub object_id: Option<crate::runtime::types::RemoteObjectId>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetAxNodeAndAncestorsParams {
node_id: fields.node_id,
backend_node_id: fields.backend_node_id,
object_id: fields.object_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetAxNodeAndAncestors;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetAxNodeAndAncestorsResponse {
#[serde(rename = "nodes")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub nodes: Vec<crate::accessibility::types::AxNode>,
}
impl<'de> serde::Deserialize<'de> for GetAxNodeAndAncestorsResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetAxNodeAndAncestorsResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "nodes")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub nodes: Vec<crate::accessibility::types::AxNode>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetAxNodeAndAncestorsResponse {
nodes: fields.nodes,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetAxNodeAndAncestors {
type Params = GetAxNodeAndAncestorsParams;
type Response = GetAxNodeAndAncestorsResponse;
const METHOD: &'static str = "Accessibility.getAXNodeAndAncestors";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetChildAxNodesParams {
#[serde(rename = "id")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub id: crate::accessibility::types::AxNodeId,
#[serde(rename = "frameId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub frame_id: Option<crate::page::types::FrameId>,
}
impl<'de> serde::Deserialize<'de> for GetChildAxNodesParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetChildAxNodesParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "id")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub id: crate::accessibility::types::AxNodeId,
#[serde(rename = "frameId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub frame_id: Option<crate::page::types::FrameId>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetChildAxNodesParams {
id: fields.id,
frame_id: fields.frame_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetChildAxNodes;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetChildAxNodesResponse {
#[serde(rename = "nodes")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub nodes: Vec<crate::accessibility::types::AxNode>,
}
impl<'de> serde::Deserialize<'de> for GetChildAxNodesResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetChildAxNodesResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "nodes")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub nodes: Vec<crate::accessibility::types::AxNode>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetChildAxNodesResponse {
nodes: fields.nodes,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetChildAxNodes {
type Params = GetChildAxNodesParams;
type Response = GetChildAxNodesResponse;
const METHOD: &'static str = "Accessibility.getChildAXNodes";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct GetFullAxTreeParams {
#[serde(rename = "depth")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub depth: Option<i64>,
#[serde(rename = "frameId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub frame_id: Option<crate::page::types::FrameId>,
}
impl<'de> serde::Deserialize<'de> for GetFullAxTreeParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetFullAxTreeParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "depth")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub depth: Option<i64>,
#[serde(rename = "frameId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub frame_id: Option<crate::page::types::FrameId>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetFullAxTreeParams {
depth: fields.depth,
frame_id: fields.frame_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetFullAxTree;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetFullAxTreeResponse {
#[serde(rename = "nodes")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub nodes: Vec<crate::accessibility::types::AxNode>,
}
impl<'de> serde::Deserialize<'de> for GetFullAxTreeResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetFullAxTreeResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "nodes")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub nodes: Vec<crate::accessibility::types::AxNode>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetFullAxTreeResponse {
nodes: fields.nodes,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetFullAxTree {
type Params = GetFullAxTreeParams;
type Response = GetFullAxTreeResponse;
const METHOD: &'static str = "Accessibility.getFullAXTree";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct GetPartialAxTreeParams {
#[serde(rename = "nodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub node_id: Option<crate::dom::types::NodeId>,
#[serde(rename = "backendNodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub backend_node_id: Option<crate::dom::types::BackendNodeId>,
#[serde(rename = "objectId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub object_id: Option<crate::runtime::types::RemoteObjectId>,
#[serde(rename = "fetchRelatives")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub fetch_relatives: Option<bool>,
}
impl<'de> serde::Deserialize<'de> for GetPartialAxTreeParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetPartialAxTreeParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "nodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub node_id: Option<crate::dom::types::NodeId>,
#[serde(rename = "backendNodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub backend_node_id: Option<crate::dom::types::BackendNodeId>,
#[serde(rename = "objectId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub object_id: Option<crate::runtime::types::RemoteObjectId>,
#[serde(rename = "fetchRelatives")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub fetch_relatives: Option<bool>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetPartialAxTreeParams {
node_id: fields.node_id,
backend_node_id: fields.backend_node_id,
object_id: fields.object_id,
fetch_relatives: fields.fetch_relatives,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetPartialAxTree;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetPartialAxTreeResponse {
#[serde(rename = "nodes")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub nodes: Vec<crate::accessibility::types::AxNode>,
}
impl<'de> serde::Deserialize<'de> for GetPartialAxTreeResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetPartialAxTreeResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "nodes")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub nodes: Vec<crate::accessibility::types::AxNode>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetPartialAxTreeResponse {
nodes: fields.nodes,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetPartialAxTree {
type Params = GetPartialAxTreeParams;
type Response = GetPartialAxTreeResponse;
const METHOD: &'static str = "Accessibility.getPartialAXTree";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct GetRootAxNodeParams {
#[serde(rename = "frameId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub frame_id: Option<crate::page::types::FrameId>,
}
impl<'de> serde::Deserialize<'de> for GetRootAxNodeParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetRootAxNodeParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "frameId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub frame_id: Option<crate::page::types::FrameId>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetRootAxNodeParams {
frame_id: fields.frame_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetRootAxNode;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetRootAxNodeResponse {
#[serde(rename = "node")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node: crate::accessibility::types::AxNode,
}
impl<'de> serde::Deserialize<'de> for GetRootAxNodeResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetRootAxNodeResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "node")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node: crate::accessibility::types::AxNode,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetRootAxNodeResponse { node: fields.node })
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetRootAxNode {
type Params = GetRootAxNodeParams;
type Response = GetRootAxNodeResponse;
const METHOD: &'static str = "Accessibility.getRootAXNode";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct QueryAxTreeParams {
#[serde(rename = "nodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub node_id: Option<crate::dom::types::NodeId>,
#[serde(rename = "backendNodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub backend_node_id: Option<crate::dom::types::BackendNodeId>,
#[serde(rename = "objectId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub object_id: Option<crate::runtime::types::RemoteObjectId>,
#[serde(rename = "accessibleName")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub accessible_name: Option<String>,
#[serde(rename = "role")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub role: Option<String>,
}
impl<'de> serde::Deserialize<'de> for QueryAxTreeParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = QueryAxTreeParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "nodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub node_id: Option<crate::dom::types::NodeId>,
#[serde(rename = "backendNodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub backend_node_id: Option<crate::dom::types::BackendNodeId>,
#[serde(rename = "objectId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub object_id: Option<crate::runtime::types::RemoteObjectId>,
#[serde(rename = "accessibleName")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub accessible_name: Option<String>,
#[serde(rename = "role")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub role: Option<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(QueryAxTreeParams {
node_id: fields.node_id,
backend_node_id: fields.backend_node_id,
object_id: fields.object_id,
accessible_name: fields.accessible_name,
role: fields.role,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct QueryAxTree;
#[derive(Debug, Clone, serde::Serialize)]
pub struct QueryAxTreeResponse {
#[serde(rename = "nodes")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub nodes: Vec<crate::accessibility::types::AxNode>,
}
impl<'de> serde::Deserialize<'de> for QueryAxTreeResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = QueryAxTreeResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "nodes")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub nodes: Vec<crate::accessibility::types::AxNode>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(QueryAxTreeResponse {
nodes: fields.nodes,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for QueryAxTree {
type Params = QueryAxTreeParams;
type Response = QueryAxTreeResponse;
const METHOD: &'static str = "Accessibility.queryAXTree";
}