#[derive(Debug, Clone, serde::Serialize)]
pub struct DragInterceptedParams {
#[serde(rename = "data")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub data: crate::input::types::DragData,
}
impl<'de> serde::Deserialize<'de> for DragInterceptedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DragInterceptedParams;
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 = "data")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub data: crate::input::types::DragData,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(DragInterceptedParams { data: fields.data })
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct DragIntercepted;
impl ydp_core::Event for DragIntercepted {
type Params = DragInterceptedParams;
const METHOD: &'static str = "Input.dragIntercepted";
}