1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
///命令 marker、完整参数与成功响应。
pub mod commands;
///事件 marker 和拥有型事件参数。
pub mod events;
///命名协议类型;不包含连接状态。
pub mod types;
///薄 Domain 视图,仅借用 Session;创建不发送数据。协议来源:Input。
pub struct Domain<'a> {
///借用的通信路由,生命周期不超过 Session。
pub(super) session: &'a ydp_core::Session,
}
impl<'a> Domain<'a> {
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:Input.command.cancelDragging。
///
///协议原文:
///
///<pre>Cancels any active dragging in the page.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::input::commands::CancelDraggingParams) -> ydp_core::Result<()> {
///let response = session.input().cancel_dragging(params).await?;
///# Ok(())
///# }
///```
pub fn cancel_dragging(
&self,
params: commands::CancelDraggingParams,
) -> ydp_core::Request<commands::CancelDragging> {
self.session.send::<commands::CancelDragging>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:Input.command.dispatchDragEvent。
///
///协议原文:
///
///<pre>Dispatches a drag event into the page.</pre>
///
///此项为 experimental,端点可能不支持。
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::input::commands::DispatchDragEventParams) -> ydp_core::Result<()> {
///let response = session.input().dispatch_drag_event(params).await?;
///# Ok(())
///# }
///```
pub fn dispatch_drag_event(
&self,
params: commands::DispatchDragEventParams,
) -> ydp_core::Request<commands::DispatchDragEvent> {
self.session.send::<commands::DispatchDragEvent>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:Input.command.dispatchKeyEvent。
///
///协议原文:
///
///<pre>Dispatches a key event to the page.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::input::commands::DispatchKeyEventParams) -> ydp_core::Result<()> {
///let response = session.input().dispatch_key_event(params).await?;
///# Ok(())
///# }
///```
pub fn dispatch_key_event(
&self,
params: commands::DispatchKeyEventParams,
) -> ydp_core::Request<commands::DispatchKeyEvent> {
self.session.send::<commands::DispatchKeyEvent>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:Input.command.dispatchMouseEvent。
///
///协议原文:
///
///<pre>Dispatches a mouse event to the page.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::input::commands::DispatchMouseEventParams) -> ydp_core::Result<()> {
///let response = session.input().dispatch_mouse_event(params).await?;
///# Ok(())
///# }
///```
pub fn dispatch_mouse_event(
&self,
params: commands::DispatchMouseEventParams,
) -> ydp_core::Request<commands::DispatchMouseEvent> {
self.session.send::<commands::DispatchMouseEvent>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:Input.command.dispatchTouchEvent。
///
///协议原文:
///
///<pre>Dispatches a touch event to the page.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::input::commands::DispatchTouchEventParams) -> ydp_core::Result<()> {
///let response = session.input().dispatch_touch_event(params).await?;
///# Ok(())
///# }
///```
pub fn dispatch_touch_event(
&self,
params: commands::DispatchTouchEventParams,
) -> ydp_core::Request<commands::DispatchTouchEvent> {
self.session.send::<commands::DispatchTouchEvent>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:Input.command.emulateTouchFromMouseEvent。
///
///协议原文:
///
///<pre>Emulates touch event from the mouse event parameters.</pre>
///
///此项为 experimental,端点可能不支持。
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::input::commands::EmulateTouchFromMouseEventParams) -> ydp_core::Result<()> {
///let response = session.input().emulate_touch_from_mouse_event(params).await?;
///# Ok(())
///# }
///```
pub fn emulate_touch_from_mouse_event(
&self,
params: commands::EmulateTouchFromMouseEventParams,
) -> ydp_core::Request<commands::EmulateTouchFromMouseEvent> {
self.session
.send::<commands::EmulateTouchFromMouseEvent>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:Input.command.imeSetComposition。
///
///协议原文:
///
///<pre>This method sets the current candidate text for IME.
///Use imeCommitComposition to commit the final text.
///Use imeSetComposition with empty string as text to cancel composition.</pre>
///
///此项为 experimental,端点可能不支持。
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::input::commands::ImeSetCompositionParams) -> ydp_core::Result<()> {
///let response = session.input().ime_set_composition(params).await?;
///# Ok(())
///# }
///```
pub fn ime_set_composition(
&self,
params: commands::ImeSetCompositionParams,
) -> ydp_core::Request<commands::ImeSetComposition> {
self.session.send::<commands::ImeSetComposition>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:Input.command.insertText。
///
///协议原文:
///
///<pre>This method emulates inserting text that doesn't come from a key press,
///for example an emoji keyboard or an IME.</pre>
///
///此项为 experimental,端点可能不支持。
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::input::commands::InsertTextParams) -> ydp_core::Result<()> {
///let response = session.input().insert_text(params).await?;
///# Ok(())
///# }
///```
pub fn insert_text(
&self,
params: commands::InsertTextParams,
) -> ydp_core::Request<commands::InsertText> {
self.session.send::<commands::InsertText>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:Input.command.setIgnoreInputEvents。
///
///协议原文:
///
///<pre>Ignores input events (useful while auditing page).</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::input::commands::SetIgnoreInputEventsParams) -> ydp_core::Result<()> {
///let response = session.input().set_ignore_input_events(params).await?;
///# Ok(())
///# }
///```
pub fn set_ignore_input_events(
&self,
params: commands::SetIgnoreInputEventsParams,
) -> ydp_core::Request<commands::SetIgnoreInputEvents> {
self.session.send::<commands::SetIgnoreInputEvents>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:Input.command.setInterceptDrags。
///
///协议原文:
///
///<pre>Prevents default drag and drop behavior and instead emits `Input.dragIntercepted` events.
///Drag and drop behavior can be directly controlled via `Input.dispatchDragEvent`.</pre>
///
///此项为 experimental,端点可能不支持。
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::input::commands::SetInterceptDragsParams) -> ydp_core::Result<()> {
///let response = session.input().set_intercept_drags(params).await?;
///# Ok(())
///# }
///```
pub fn set_intercept_drags(
&self,
params: commands::SetInterceptDragsParams,
) -> ydp_core::Request<commands::SetInterceptDrags> {
self.session.send::<commands::SetInterceptDrags>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:Input.command.synthesizePinchGesture。
///
///协议原文:
///
///<pre>Synthesizes a pinch gesture over a time period by issuing appropriate touch events.</pre>
///
///此项为 experimental,端点可能不支持。
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::input::commands::SynthesizePinchGestureParams) -> ydp_core::Result<()> {
///let response = session.input().synthesize_pinch_gesture(params).await?;
///# Ok(())
///# }
///```
pub fn synthesize_pinch_gesture(
&self,
params: commands::SynthesizePinchGestureParams,
) -> ydp_core::Request<commands::SynthesizePinchGesture> {
self.session
.send::<commands::SynthesizePinchGesture>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:Input.command.synthesizeScrollGesture。
///
///协议原文:
///
///<pre>Synthesizes a scroll gesture over a time period by issuing appropriate touch events.</pre>
///
///此项为 experimental,端点可能不支持。
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::input::commands::SynthesizeScrollGestureParams) -> ydp_core::Result<()> {
///let response = session.input().synthesize_scroll_gesture(params).await?;
///# Ok(())
///# }
///```
pub fn synthesize_scroll_gesture(
&self,
params: commands::SynthesizeScrollGestureParams,
) -> ydp_core::Request<commands::SynthesizeScrollGesture> {
self.session
.send::<commands::SynthesizeScrollGesture>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:Input.command.synthesizeTapGesture。
///
///协议原文:
///
///<pre>Synthesizes a tap gesture over a time period by issuing appropriate touch events.</pre>
///
///此项为 experimental,端点可能不支持。
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::input::commands::SynthesizeTapGestureParams) -> ydp_core::Result<()> {
///let response = session.input().synthesize_tap_gesture(params).await?;
///# Ok(())
///# }
///```
pub fn synthesize_tap_gesture(
&self,
params: commands::SynthesizeTapGestureParams,
) -> ydp_core::Request<commands::SynthesizeTapGesture> {
self.session.send::<commands::SynthesizeTapGesture>(params)
}
}