#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct CancelDraggingParams {}
impl<'de> serde::Deserialize<'de> for CancelDraggingParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CancelDraggingParams;
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(CancelDraggingParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct CancelDragging;
#[derive(Debug, Clone, serde::Serialize)]
pub struct CancelDraggingResponse {}
impl<'de> serde::Deserialize<'de> for CancelDraggingResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CancelDraggingResponse;
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(CancelDraggingResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for CancelDragging {
type Params = CancelDraggingParams;
type Response = CancelDraggingResponse;
const METHOD: &'static str = "Input.cancelDragging";
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum DispatchDragEventParamsType {
DragEnter,
DragOver,
Drop,
DragCancel,
Unknown(String),
}
impl DispatchDragEventParamsType {
pub fn as_str(&self) -> &str {
match self {
Self::DragEnter => "dragEnter",
Self::DragOver => "dragOver",
Self::Drop => "drop",
Self::DragCancel => "dragCancel",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for DispatchDragEventParamsType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for DispatchDragEventParamsType {
fn from(value: String) -> Self {
match value.as_str() {
"dragEnter" => DispatchDragEventParamsType::DragEnter,
"dragOver" => DispatchDragEventParamsType::DragOver,
"drop" => DispatchDragEventParamsType::Drop,
"dragCancel" => DispatchDragEventParamsType::DragCancel,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for DispatchDragEventParamsType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for DispatchDragEventParamsType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DispatchDragEventParamsType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"dragEnter" => DispatchDragEventParamsType::DragEnter,
"dragOver" => DispatchDragEventParamsType::DragOver,
"drop" => DispatchDragEventParamsType::Drop,
"dragCancel" => DispatchDragEventParamsType::DragCancel,
_ => DispatchDragEventParamsType::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(DispatchDragEventParamsType::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct DispatchDragEventParams {
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: DispatchDragEventParamsType,
#[serde(rename = "x")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub x: ydp_core::FiniteF64,
#[serde(rename = "y")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub y: ydp_core::FiniteF64,
#[serde(rename = "data")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub data: crate::input::types::DragData,
#[serde(rename = "modifiers")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub modifiers: Option<i64>,
}
impl<'de> serde::Deserialize<'de> for DispatchDragEventParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DispatchDragEventParams;
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 = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: DispatchDragEventParamsType,
#[serde(rename = "x")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub x: ydp_core::FiniteF64,
#[serde(rename = "y")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub y: ydp_core::FiniteF64,
#[serde(rename = "data")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub data: crate::input::types::DragData,
#[serde(rename = "modifiers")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub modifiers: Option<i64>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(DispatchDragEventParams {
r#type: fields.r#type,
x: fields.x,
y: fields.y,
data: fields.data,
modifiers: fields.modifiers,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct DispatchDragEvent;
#[derive(Debug, Clone, serde::Serialize)]
pub struct DispatchDragEventResponse {}
impl<'de> serde::Deserialize<'de> for DispatchDragEventResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DispatchDragEventResponse;
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(DispatchDragEventResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for DispatchDragEvent {
type Params = DispatchDragEventParams;
type Response = DispatchDragEventResponse;
const METHOD: &'static str = "Input.dispatchDragEvent";
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum DispatchKeyEventParamsType {
KeyDown,
KeyUp,
RawKeyDown,
Char,
Unknown(String),
}
impl DispatchKeyEventParamsType {
pub fn as_str(&self) -> &str {
match self {
Self::KeyDown => "keyDown",
Self::KeyUp => "keyUp",
Self::RawKeyDown => "rawKeyDown",
Self::Char => "char",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for DispatchKeyEventParamsType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for DispatchKeyEventParamsType {
fn from(value: String) -> Self {
match value.as_str() {
"keyDown" => DispatchKeyEventParamsType::KeyDown,
"keyUp" => DispatchKeyEventParamsType::KeyUp,
"rawKeyDown" => DispatchKeyEventParamsType::RawKeyDown,
"char" => DispatchKeyEventParamsType::Char,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for DispatchKeyEventParamsType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for DispatchKeyEventParamsType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DispatchKeyEventParamsType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"keyDown" => DispatchKeyEventParamsType::KeyDown,
"keyUp" => DispatchKeyEventParamsType::KeyUp,
"rawKeyDown" => DispatchKeyEventParamsType::RawKeyDown,
"char" => DispatchKeyEventParamsType::Char,
_ => DispatchKeyEventParamsType::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(DispatchKeyEventParamsType::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct DispatchKeyEventParams {
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: DispatchKeyEventParamsType,
#[serde(rename = "modifiers")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub modifiers: Option<i64>,
#[serde(rename = "timestamp")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub timestamp: Option<crate::input::types::TimeSinceEpoch>,
#[serde(rename = "text")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub text: Option<String>,
#[serde(rename = "unmodifiedText")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub unmodified_text: Option<String>,
#[serde(rename = "keyIdentifier")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub key_identifier: Option<String>,
#[serde(rename = "code")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub code: Option<String>,
#[serde(rename = "key")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub key: Option<String>,
#[serde(rename = "windowsVirtualKeyCode")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub windows_virtual_key_code: Option<i64>,
#[serde(rename = "nativeVirtualKeyCode")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub native_virtual_key_code: Option<i64>,
#[serde(rename = "autoRepeat")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub auto_repeat: Option<bool>,
#[serde(rename = "isKeypad")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub is_keypad: Option<bool>,
#[serde(rename = "isSystemKey")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub is_system_key: Option<bool>,
#[serde(rename = "location")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub location: Option<i64>,
#[serde(rename = "commands")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub commands: Option<Vec<String>>,
}
impl<'de> serde::Deserialize<'de> for DispatchKeyEventParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DispatchKeyEventParams;
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 = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: DispatchKeyEventParamsType,
#[serde(rename = "modifiers")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub modifiers: Option<i64>,
#[serde(rename = "timestamp")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub timestamp: Option<crate::input::types::TimeSinceEpoch>,
#[serde(rename = "text")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub text: Option<String>,
#[serde(rename = "unmodifiedText")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub unmodified_text: Option<String>,
#[serde(rename = "keyIdentifier")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub key_identifier: Option<String>,
#[serde(rename = "code")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub code: Option<String>,
#[serde(rename = "key")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub key: Option<String>,
#[serde(rename = "windowsVirtualKeyCode")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub windows_virtual_key_code: Option<i64>,
#[serde(rename = "nativeVirtualKeyCode")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub native_virtual_key_code: Option<i64>,
#[serde(rename = "autoRepeat")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub auto_repeat: Option<bool>,
#[serde(rename = "isKeypad")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub is_keypad: Option<bool>,
#[serde(rename = "isSystemKey")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub is_system_key: Option<bool>,
#[serde(rename = "location")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub location: Option<i64>,
#[serde(rename = "commands")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub commands: Option<Vec<String>>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(DispatchKeyEventParams {
r#type: fields.r#type,
modifiers: fields.modifiers,
timestamp: fields.timestamp,
text: fields.text,
unmodified_text: fields.unmodified_text,
key_identifier: fields.key_identifier,
code: fields.code,
key: fields.key,
windows_virtual_key_code: fields.windows_virtual_key_code,
native_virtual_key_code: fields.native_virtual_key_code,
auto_repeat: fields.auto_repeat,
is_keypad: fields.is_keypad,
is_system_key: fields.is_system_key,
location: fields.location,
commands: fields.commands,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct DispatchKeyEvent;
#[derive(Debug, Clone, serde::Serialize)]
pub struct DispatchKeyEventResponse {}
impl<'de> serde::Deserialize<'de> for DispatchKeyEventResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DispatchKeyEventResponse;
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(DispatchKeyEventResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for DispatchKeyEvent {
type Params = DispatchKeyEventParams;
type Response = DispatchKeyEventResponse;
const METHOD: &'static str = "Input.dispatchKeyEvent";
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum DispatchMouseEventParamsType {
MousePressed,
MouseReleased,
MouseMoved,
MouseWheel,
Unknown(String),
}
impl DispatchMouseEventParamsType {
pub fn as_str(&self) -> &str {
match self {
Self::MousePressed => "mousePressed",
Self::MouseReleased => "mouseReleased",
Self::MouseMoved => "mouseMoved",
Self::MouseWheel => "mouseWheel",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for DispatchMouseEventParamsType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for DispatchMouseEventParamsType {
fn from(value: String) -> Self {
match value.as_str() {
"mousePressed" => DispatchMouseEventParamsType::MousePressed,
"mouseReleased" => DispatchMouseEventParamsType::MouseReleased,
"mouseMoved" => DispatchMouseEventParamsType::MouseMoved,
"mouseWheel" => DispatchMouseEventParamsType::MouseWheel,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for DispatchMouseEventParamsType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for DispatchMouseEventParamsType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DispatchMouseEventParamsType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"mousePressed" => DispatchMouseEventParamsType::MousePressed,
"mouseReleased" => DispatchMouseEventParamsType::MouseReleased,
"mouseMoved" => DispatchMouseEventParamsType::MouseMoved,
"mouseWheel" => DispatchMouseEventParamsType::MouseWheel,
_ => DispatchMouseEventParamsType::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(DispatchMouseEventParamsType::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum DispatchMouseEventParamsPointerType {
Mouse,
Pen,
Unknown(String),
}
impl DispatchMouseEventParamsPointerType {
pub fn as_str(&self) -> &str {
match self {
Self::Mouse => "mouse",
Self::Pen => "pen",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for DispatchMouseEventParamsPointerType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for DispatchMouseEventParamsPointerType {
fn from(value: String) -> Self {
match value.as_str() {
"mouse" => DispatchMouseEventParamsPointerType::Mouse,
"pen" => DispatchMouseEventParamsPointerType::Pen,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for DispatchMouseEventParamsPointerType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for DispatchMouseEventParamsPointerType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DispatchMouseEventParamsPointerType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"mouse" => DispatchMouseEventParamsPointerType::Mouse,
"pen" => DispatchMouseEventParamsPointerType::Pen,
_ => DispatchMouseEventParamsPointerType::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(DispatchMouseEventParamsPointerType::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct DispatchMouseEventParams {
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: DispatchMouseEventParamsType,
#[serde(rename = "x")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub x: ydp_core::FiniteF64,
#[serde(rename = "y")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub y: ydp_core::FiniteF64,
#[serde(rename = "modifiers")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub modifiers: Option<i64>,
#[serde(rename = "timestamp")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub timestamp: Option<crate::input::types::TimeSinceEpoch>,
#[serde(rename = "button")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub button: Option<crate::input::types::MouseButton>,
#[serde(rename = "buttons")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub buttons: Option<i64>,
#[serde(rename = "clickCount")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub click_count: Option<i64>,
#[serde(rename = "force")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub force: Option<ydp_core::FiniteF64>,
#[serde(rename = "tangentialPressure")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub tangential_pressure: Option<ydp_core::FiniteF64>,
#[serde(rename = "tiltX")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub tilt_x: Option<ydp_core::FiniteF64>,
#[serde(rename = "tiltY")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub tilt_y: Option<ydp_core::FiniteF64>,
#[serde(rename = "twist")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub twist: Option<i64>,
#[serde(rename = "deltaX")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub delta_x: Option<ydp_core::FiniteF64>,
#[serde(rename = "deltaY")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub delta_y: Option<ydp_core::FiniteF64>,
#[serde(rename = "pointerType")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub pointer_type: Option<DispatchMouseEventParamsPointerType>,
}
impl<'de> serde::Deserialize<'de> for DispatchMouseEventParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DispatchMouseEventParams;
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 = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: DispatchMouseEventParamsType,
#[serde(rename = "x")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub x: ydp_core::FiniteF64,
#[serde(rename = "y")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub y: ydp_core::FiniteF64,
#[serde(rename = "modifiers")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub modifiers: Option<i64>,
#[serde(rename = "timestamp")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub timestamp: Option<crate::input::types::TimeSinceEpoch>,
#[serde(rename = "button")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub button: Option<crate::input::types::MouseButton>,
#[serde(rename = "buttons")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub buttons: Option<i64>,
#[serde(rename = "clickCount")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub click_count: Option<i64>,
#[serde(rename = "force")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub force: Option<ydp_core::FiniteF64>,
#[serde(rename = "tangentialPressure")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub tangential_pressure: Option<ydp_core::FiniteF64>,
#[serde(rename = "tiltX")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub tilt_x: Option<ydp_core::FiniteF64>,
#[serde(rename = "tiltY")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub tilt_y: Option<ydp_core::FiniteF64>,
#[serde(rename = "twist")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub twist: Option<i64>,
#[serde(rename = "deltaX")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub delta_x: Option<ydp_core::FiniteF64>,
#[serde(rename = "deltaY")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub delta_y: Option<ydp_core::FiniteF64>,
#[serde(rename = "pointerType")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub pointer_type: Option<DispatchMouseEventParamsPointerType>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(DispatchMouseEventParams {
r#type: fields.r#type,
x: fields.x,
y: fields.y,
modifiers: fields.modifiers,
timestamp: fields.timestamp,
button: fields.button,
buttons: fields.buttons,
click_count: fields.click_count,
force: fields.force,
tangential_pressure: fields.tangential_pressure,
tilt_x: fields.tilt_x,
tilt_y: fields.tilt_y,
twist: fields.twist,
delta_x: fields.delta_x,
delta_y: fields.delta_y,
pointer_type: fields.pointer_type,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct DispatchMouseEvent;
#[derive(Debug, Clone, serde::Serialize)]
pub struct DispatchMouseEventResponse {}
impl<'de> serde::Deserialize<'de> for DispatchMouseEventResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DispatchMouseEventResponse;
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(DispatchMouseEventResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for DispatchMouseEvent {
type Params = DispatchMouseEventParams;
type Response = DispatchMouseEventResponse;
const METHOD: &'static str = "Input.dispatchMouseEvent";
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum DispatchTouchEventParamsType {
TouchStart,
TouchEnd,
TouchMove,
TouchCancel,
Unknown(String),
}
impl DispatchTouchEventParamsType {
pub fn as_str(&self) -> &str {
match self {
Self::TouchStart => "touchStart",
Self::TouchEnd => "touchEnd",
Self::TouchMove => "touchMove",
Self::TouchCancel => "touchCancel",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for DispatchTouchEventParamsType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for DispatchTouchEventParamsType {
fn from(value: String) -> Self {
match value.as_str() {
"touchStart" => DispatchTouchEventParamsType::TouchStart,
"touchEnd" => DispatchTouchEventParamsType::TouchEnd,
"touchMove" => DispatchTouchEventParamsType::TouchMove,
"touchCancel" => DispatchTouchEventParamsType::TouchCancel,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for DispatchTouchEventParamsType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for DispatchTouchEventParamsType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DispatchTouchEventParamsType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"touchStart" => DispatchTouchEventParamsType::TouchStart,
"touchEnd" => DispatchTouchEventParamsType::TouchEnd,
"touchMove" => DispatchTouchEventParamsType::TouchMove,
"touchCancel" => DispatchTouchEventParamsType::TouchCancel,
_ => DispatchTouchEventParamsType::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(DispatchTouchEventParamsType::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct DispatchTouchEventParams {
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: DispatchTouchEventParamsType,
#[serde(rename = "touchPoints")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub touch_points: Vec<crate::input::types::TouchPoint>,
#[serde(rename = "modifiers")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub modifiers: Option<i64>,
#[serde(rename = "timestamp")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub timestamp: Option<crate::input::types::TimeSinceEpoch>,
}
impl<'de> serde::Deserialize<'de> for DispatchTouchEventParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DispatchTouchEventParams;
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 = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: DispatchTouchEventParamsType,
#[serde(rename = "touchPoints")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub touch_points: Vec<crate::input::types::TouchPoint>,
#[serde(rename = "modifiers")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub modifiers: Option<i64>,
#[serde(rename = "timestamp")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub timestamp: Option<crate::input::types::TimeSinceEpoch>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(DispatchTouchEventParams {
r#type: fields.r#type,
touch_points: fields.touch_points,
modifiers: fields.modifiers,
timestamp: fields.timestamp,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct DispatchTouchEvent;
#[derive(Debug, Clone, serde::Serialize)]
pub struct DispatchTouchEventResponse {}
impl<'de> serde::Deserialize<'de> for DispatchTouchEventResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DispatchTouchEventResponse;
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(DispatchTouchEventResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for DispatchTouchEvent {
type Params = DispatchTouchEventParams;
type Response = DispatchTouchEventResponse;
const METHOD: &'static str = "Input.dispatchTouchEvent";
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum EmulateTouchFromMouseEventParamsType {
MousePressed,
MouseReleased,
MouseMoved,
MouseWheel,
Unknown(String),
}
impl EmulateTouchFromMouseEventParamsType {
pub fn as_str(&self) -> &str {
match self {
Self::MousePressed => "mousePressed",
Self::MouseReleased => "mouseReleased",
Self::MouseMoved => "mouseMoved",
Self::MouseWheel => "mouseWheel",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for EmulateTouchFromMouseEventParamsType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for EmulateTouchFromMouseEventParamsType {
fn from(value: String) -> Self {
match value.as_str() {
"mousePressed" => EmulateTouchFromMouseEventParamsType::MousePressed,
"mouseReleased" => EmulateTouchFromMouseEventParamsType::MouseReleased,
"mouseMoved" => EmulateTouchFromMouseEventParamsType::MouseMoved,
"mouseWheel" => EmulateTouchFromMouseEventParamsType::MouseWheel,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for EmulateTouchFromMouseEventParamsType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for EmulateTouchFromMouseEventParamsType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EmulateTouchFromMouseEventParamsType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"mousePressed" => EmulateTouchFromMouseEventParamsType::MousePressed,
"mouseReleased" => EmulateTouchFromMouseEventParamsType::MouseReleased,
"mouseMoved" => EmulateTouchFromMouseEventParamsType::MouseMoved,
"mouseWheel" => EmulateTouchFromMouseEventParamsType::MouseWheel,
_ => EmulateTouchFromMouseEventParamsType::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(EmulateTouchFromMouseEventParamsType::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct EmulateTouchFromMouseEventParams {
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: EmulateTouchFromMouseEventParamsType,
#[serde(rename = "x")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub x: i64,
#[serde(rename = "y")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub y: i64,
#[serde(rename = "button")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub button: crate::input::types::MouseButton,
#[serde(rename = "timestamp")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub timestamp: Option<crate::input::types::TimeSinceEpoch>,
#[serde(rename = "deltaX")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub delta_x: Option<ydp_core::FiniteF64>,
#[serde(rename = "deltaY")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub delta_y: Option<ydp_core::FiniteF64>,
#[serde(rename = "modifiers")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub modifiers: Option<i64>,
#[serde(rename = "clickCount")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub click_count: Option<i64>,
}
impl<'de> serde::Deserialize<'de> for EmulateTouchFromMouseEventParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EmulateTouchFromMouseEventParams;
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 = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: EmulateTouchFromMouseEventParamsType,
#[serde(rename = "x")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub x: i64,
#[serde(rename = "y")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub y: i64,
#[serde(rename = "button")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub button: crate::input::types::MouseButton,
#[serde(rename = "timestamp")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub timestamp: Option<crate::input::types::TimeSinceEpoch>,
#[serde(rename = "deltaX")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub delta_x: Option<ydp_core::FiniteF64>,
#[serde(rename = "deltaY")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub delta_y: Option<ydp_core::FiniteF64>,
#[serde(rename = "modifiers")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub modifiers: Option<i64>,
#[serde(rename = "clickCount")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub click_count: Option<i64>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(EmulateTouchFromMouseEventParams {
r#type: fields.r#type,
x: fields.x,
y: fields.y,
button: fields.button,
timestamp: fields.timestamp,
delta_x: fields.delta_x,
delta_y: fields.delta_y,
modifiers: fields.modifiers,
click_count: fields.click_count,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct EmulateTouchFromMouseEvent;
#[derive(Debug, Clone, serde::Serialize)]
pub struct EmulateTouchFromMouseEventResponse {}
impl<'de> serde::Deserialize<'de> for EmulateTouchFromMouseEventResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EmulateTouchFromMouseEventResponse;
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(EmulateTouchFromMouseEventResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for EmulateTouchFromMouseEvent {
type Params = EmulateTouchFromMouseEventParams;
type Response = EmulateTouchFromMouseEventResponse;
const METHOD: &'static str = "Input.emulateTouchFromMouseEvent";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ImeSetCompositionParams {
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
#[serde(rename = "selectionStart")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub selection_start: i64,
#[serde(rename = "selectionEnd")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub selection_end: i64,
#[serde(rename = "replacementStart")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub replacement_start: Option<i64>,
#[serde(rename = "replacementEnd")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub replacement_end: Option<i64>,
}
impl<'de> serde::Deserialize<'de> for ImeSetCompositionParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ImeSetCompositionParams;
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 = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
#[serde(rename = "selectionStart")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub selection_start: i64,
#[serde(rename = "selectionEnd")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub selection_end: i64,
#[serde(rename = "replacementStart")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub replacement_start: Option<i64>,
#[serde(rename = "replacementEnd")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub replacement_end: Option<i64>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ImeSetCompositionParams {
text: fields.text,
selection_start: fields.selection_start,
selection_end: fields.selection_end,
replacement_start: fields.replacement_start,
replacement_end: fields.replacement_end,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ImeSetComposition;
#[derive(Debug, Clone, serde::Serialize)]
pub struct ImeSetCompositionResponse {}
impl<'de> serde::Deserialize<'de> for ImeSetCompositionResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ImeSetCompositionResponse;
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(ImeSetCompositionResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for ImeSetComposition {
type Params = ImeSetCompositionParams;
type Response = ImeSetCompositionResponse;
const METHOD: &'static str = "Input.imeSetComposition";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct InsertTextParams {
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
impl<'de> serde::Deserialize<'de> for InsertTextParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = InsertTextParams;
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 = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(InsertTextParams { text: fields.text })
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct InsertText;
#[derive(Debug, Clone, serde::Serialize)]
pub struct InsertTextResponse {}
impl<'de> serde::Deserialize<'de> for InsertTextResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = InsertTextResponse;
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(InsertTextResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for InsertText {
type Params = InsertTextParams;
type Response = InsertTextResponse;
const METHOD: &'static str = "Input.insertText";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetIgnoreInputEventsParams {
#[serde(rename = "ignore")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub ignore: bool,
}
impl<'de> serde::Deserialize<'de> for SetIgnoreInputEventsParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetIgnoreInputEventsParams;
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 = "ignore")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub ignore: bool,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetIgnoreInputEventsParams {
ignore: fields.ignore,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetIgnoreInputEvents;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetIgnoreInputEventsResponse {}
impl<'de> serde::Deserialize<'de> for SetIgnoreInputEventsResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetIgnoreInputEventsResponse;
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(SetIgnoreInputEventsResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetIgnoreInputEvents {
type Params = SetIgnoreInputEventsParams;
type Response = SetIgnoreInputEventsResponse;
const METHOD: &'static str = "Input.setIgnoreInputEvents";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetInterceptDragsParams {
#[serde(rename = "enabled")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub enabled: bool,
}
impl<'de> serde::Deserialize<'de> for SetInterceptDragsParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetInterceptDragsParams;
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 = "enabled")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub enabled: bool,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetInterceptDragsParams {
enabled: fields.enabled,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetInterceptDrags;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetInterceptDragsResponse {}
impl<'de> serde::Deserialize<'de> for SetInterceptDragsResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetInterceptDragsResponse;
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(SetInterceptDragsResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetInterceptDrags {
type Params = SetInterceptDragsParams;
type Response = SetInterceptDragsResponse;
const METHOD: &'static str = "Input.setInterceptDrags";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SynthesizePinchGestureParams {
#[serde(rename = "x")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub x: ydp_core::FiniteF64,
#[serde(rename = "y")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub y: ydp_core::FiniteF64,
#[serde(rename = "scaleFactor")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub scale_factor: ydp_core::FiniteF64,
#[serde(rename = "relativeSpeed")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub relative_speed: Option<i64>,
#[serde(rename = "gestureSourceType")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub gesture_source_type: Option<crate::input::types::GestureSourceType>,
}
impl<'de> serde::Deserialize<'de> for SynthesizePinchGestureParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SynthesizePinchGestureParams;
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 = "x")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub x: ydp_core::FiniteF64,
#[serde(rename = "y")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub y: ydp_core::FiniteF64,
#[serde(rename = "scaleFactor")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub scale_factor: ydp_core::FiniteF64,
#[serde(rename = "relativeSpeed")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub relative_speed: Option<i64>,
#[serde(rename = "gestureSourceType")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub gesture_source_type: Option<crate::input::types::GestureSourceType>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SynthesizePinchGestureParams {
x: fields.x,
y: fields.y,
scale_factor: fields.scale_factor,
relative_speed: fields.relative_speed,
gesture_source_type: fields.gesture_source_type,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SynthesizePinchGesture;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SynthesizePinchGestureResponse {}
impl<'de> serde::Deserialize<'de> for SynthesizePinchGestureResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SynthesizePinchGestureResponse;
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(SynthesizePinchGestureResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SynthesizePinchGesture {
type Params = SynthesizePinchGestureParams;
type Response = SynthesizePinchGestureResponse;
const METHOD: &'static str = "Input.synthesizePinchGesture";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SynthesizeScrollGestureParams {
#[serde(rename = "x")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub x: ydp_core::FiniteF64,
#[serde(rename = "y")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub y: ydp_core::FiniteF64,
#[serde(rename = "xDistance")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub x_distance: Option<ydp_core::FiniteF64>,
#[serde(rename = "yDistance")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub y_distance: Option<ydp_core::FiniteF64>,
#[serde(rename = "xOverscroll")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub x_overscroll: Option<ydp_core::FiniteF64>,
#[serde(rename = "yOverscroll")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub y_overscroll: Option<ydp_core::FiniteF64>,
#[serde(rename = "preventFling")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub prevent_fling: Option<bool>,
#[serde(rename = "speed")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub speed: Option<i64>,
#[serde(rename = "gestureSourceType")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub gesture_source_type: Option<crate::input::types::GestureSourceType>,
#[serde(rename = "repeatCount")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub repeat_count: Option<i64>,
#[serde(rename = "repeatDelayMs")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub repeat_delay_ms: Option<i64>,
#[serde(rename = "interactionMarkerName")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub interaction_marker_name: Option<String>,
}
impl<'de> serde::Deserialize<'de> for SynthesizeScrollGestureParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SynthesizeScrollGestureParams;
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 = "x")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub x: ydp_core::FiniteF64,
#[serde(rename = "y")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub y: ydp_core::FiniteF64,
#[serde(rename = "xDistance")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub x_distance: Option<ydp_core::FiniteF64>,
#[serde(rename = "yDistance")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub y_distance: Option<ydp_core::FiniteF64>,
#[serde(rename = "xOverscroll")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub x_overscroll: Option<ydp_core::FiniteF64>,
#[serde(rename = "yOverscroll")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub y_overscroll: Option<ydp_core::FiniteF64>,
#[serde(rename = "preventFling")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub prevent_fling: Option<bool>,
#[serde(rename = "speed")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub speed: Option<i64>,
#[serde(rename = "gestureSourceType")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub gesture_source_type: Option<crate::input::types::GestureSourceType>,
#[serde(rename = "repeatCount")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub repeat_count: Option<i64>,
#[serde(rename = "repeatDelayMs")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub repeat_delay_ms: Option<i64>,
#[serde(rename = "interactionMarkerName")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub interaction_marker_name: Option<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SynthesizeScrollGestureParams {
x: fields.x,
y: fields.y,
x_distance: fields.x_distance,
y_distance: fields.y_distance,
x_overscroll: fields.x_overscroll,
y_overscroll: fields.y_overscroll,
prevent_fling: fields.prevent_fling,
speed: fields.speed,
gesture_source_type: fields.gesture_source_type,
repeat_count: fields.repeat_count,
repeat_delay_ms: fields.repeat_delay_ms,
interaction_marker_name: fields.interaction_marker_name,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SynthesizeScrollGesture;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SynthesizeScrollGestureResponse {}
impl<'de> serde::Deserialize<'de> for SynthesizeScrollGestureResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SynthesizeScrollGestureResponse;
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(SynthesizeScrollGestureResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SynthesizeScrollGesture {
type Params = SynthesizeScrollGestureParams;
type Response = SynthesizeScrollGestureResponse;
const METHOD: &'static str = "Input.synthesizeScrollGesture";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SynthesizeTapGestureParams {
#[serde(rename = "x")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub x: ydp_core::FiniteF64,
#[serde(rename = "y")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub y: ydp_core::FiniteF64,
#[serde(rename = "duration")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub duration: Option<i64>,
#[serde(rename = "tapCount")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub tap_count: Option<i64>,
#[serde(rename = "gestureSourceType")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub gesture_source_type: Option<crate::input::types::GestureSourceType>,
}
impl<'de> serde::Deserialize<'de> for SynthesizeTapGestureParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SynthesizeTapGestureParams;
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 = "x")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub x: ydp_core::FiniteF64,
#[serde(rename = "y")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub y: ydp_core::FiniteF64,
#[serde(rename = "duration")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub duration: Option<i64>,
#[serde(rename = "tapCount")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub tap_count: Option<i64>,
#[serde(rename = "gestureSourceType")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub gesture_source_type: Option<crate::input::types::GestureSourceType>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SynthesizeTapGestureParams {
x: fields.x,
y: fields.y,
duration: fields.duration,
tap_count: fields.tap_count,
gesture_source_type: fields.gesture_source_type,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SynthesizeTapGesture;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SynthesizeTapGestureResponse {}
impl<'de> serde::Deserialize<'de> for SynthesizeTapGestureResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SynthesizeTapGestureResponse;
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(SynthesizeTapGestureResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SynthesizeTapGesture {
type Params = SynthesizeTapGestureParams;
type Response = SynthesizeTapGestureResponse;
const METHOD: &'static str = "Input.synthesizeTapGesture";
}