#[derive(Debug, Clone, serde::Serialize)]
pub struct LoadCompleteParams {
#[serde(rename = "root")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub root: crate::accessibility::types::AxNode,
}
impl<'de> serde::Deserialize<'de> for LoadCompleteParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = LoadCompleteParams;
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 = "root")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub root: crate::accessibility::types::AxNode,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(LoadCompleteParams { root: fields.root })
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct LoadComplete;
impl ydp_core::Event for LoadComplete {
type Params = LoadCompleteParams;
const METHOD: &'static str = "Accessibility.loadComplete";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct NodesUpdatedParams {
#[serde(rename = "nodes")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub nodes: Vec<crate::accessibility::types::AxNode>,
}
impl<'de> serde::Deserialize<'de> for NodesUpdatedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = NodesUpdatedParams;
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(NodesUpdatedParams {
nodes: fields.nodes,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct NodesUpdated;
impl ydp_core::Event for NodesUpdated {
type Params = NodesUpdatedParams;
const METHOD: &'static str = "Accessibility.nodesUpdated";
}