1use serde::{Serialize, Deserialize};
2use serde_json::Value as JsonValue;
3use std::borrow::Cow;
4
5
6#[derive(Debug, Clone, Serialize, Deserialize, Default)]
7#[serde(rename_all = "camelCase")]
8pub struct TouchPoint {
9 x: f64,
11 y: f64,
14 #[serde(skip_serializing_if = "Option::is_none", rename = "radiusX")]
16 radius_x: Option<f64>,
17 #[serde(skip_serializing_if = "Option::is_none", rename = "radiusY")]
19 radius_y: Option<f64>,
20 #[serde(skip_serializing_if = "Option::is_none", rename = "rotationAngle")]
22 rotation_angle: Option<f64>,
23 #[serde(skip_serializing_if = "Option::is_none")]
25 force: Option<f64>,
26 #[serde(skip_serializing_if = "Option::is_none", rename = "tangentialPressure")]
28 tangential_pressure: Option<f64>,
29 #[serde(skip_serializing_if = "Option::is_none", rename = "tiltX")]
31 tilt_x: Option<f64>,
32 #[serde(skip_serializing_if = "Option::is_none", rename = "tiltY")]
34 tilt_y: Option<f64>,
35 #[serde(skip_serializing_if = "Option::is_none")]
37 twist: Option<i64>,
38 #[serde(skip_serializing_if = "Option::is_none")]
40 id: Option<f64>,
41}
42
43impl TouchPoint {
44 pub fn builder(x: f64, y: f64) -> TouchPointBuilder {
48 TouchPointBuilder {
49 x: x,
50 y: y,
51 radius_x: None,
52 radius_y: None,
53 rotation_angle: None,
54 force: None,
55 tangential_pressure: None,
56 tilt_x: None,
57 tilt_y: None,
58 twist: None,
59 id: None,
60 }
61 }
62 pub fn x(&self) -> f64 { self.x }
64 pub fn y(&self) -> f64 { self.y }
67 pub fn radius_x(&self) -> Option<f64> { self.radius_x }
69 pub fn radius_y(&self) -> Option<f64> { self.radius_y }
71 pub fn rotation_angle(&self) -> Option<f64> { self.rotation_angle }
73 pub fn force(&self) -> Option<f64> { self.force }
75 pub fn tangential_pressure(&self) -> Option<f64> { self.tangential_pressure }
77 pub fn tilt_x(&self) -> Option<f64> { self.tilt_x }
79 pub fn tilt_y(&self) -> Option<f64> { self.tilt_y }
81 pub fn twist(&self) -> Option<i64> { self.twist }
83 pub fn id(&self) -> Option<f64> { self.id }
85}
86
87
88pub struct TouchPointBuilder {
89 x: f64,
90 y: f64,
91 radius_x: Option<f64>,
92 radius_y: Option<f64>,
93 rotation_angle: Option<f64>,
94 force: Option<f64>,
95 tangential_pressure: Option<f64>,
96 tilt_x: Option<f64>,
97 tilt_y: Option<f64>,
98 twist: Option<i64>,
99 id: Option<f64>,
100}
101
102impl TouchPointBuilder {
103 pub fn radius_x(mut self, radius_x: f64) -> Self { self.radius_x = Some(radius_x); self }
105 pub fn radius_y(mut self, radius_y: f64) -> Self { self.radius_y = Some(radius_y); self }
107 pub fn rotation_angle(mut self, rotation_angle: f64) -> Self { self.rotation_angle = Some(rotation_angle); self }
109 pub fn force(mut self, force: f64) -> Self { self.force = Some(force); self }
111 pub fn tangential_pressure(mut self, tangential_pressure: f64) -> Self { self.tangential_pressure = Some(tangential_pressure); self }
113 pub fn tilt_x(mut self, tilt_x: f64) -> Self { self.tilt_x = Some(tilt_x); self }
115 pub fn tilt_y(mut self, tilt_y: f64) -> Self { self.tilt_y = Some(tilt_y); self }
117 pub fn twist(mut self, twist: i64) -> Self { self.twist = Some(twist); self }
119 pub fn id(mut self, id: f64) -> Self { self.id = Some(id); self }
121 pub fn build(self) -> TouchPoint {
122 TouchPoint {
123 x: self.x,
124 y: self.y,
125 radius_x: self.radius_x,
126 radius_y: self.radius_y,
127 rotation_angle: self.rotation_angle,
128 force: self.force,
129 tangential_pressure: self.tangential_pressure,
130 tilt_x: self.tilt_x,
131 tilt_y: self.tilt_y,
132 twist: self.twist,
133 id: self.id,
134 }
135 }
136}
137
138
139#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
140pub enum GestureSourceType {
141 #[default]
142 #[serde(rename = "default")]
143 Default,
144 #[serde(rename = "touch")]
145 Touch,
146 #[serde(rename = "mouse")]
147 Mouse,
148}
149
150
151#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
152pub enum MouseButton {
153 #[default]
154 #[serde(rename = "none")]
155 None,
156 #[serde(rename = "left")]
157 Left,
158 #[serde(rename = "middle")]
159 Middle,
160 #[serde(rename = "right")]
161 Right,
162 #[serde(rename = "back")]
163 Back,
164 #[serde(rename = "forward")]
165 Forward,
166}
167
168pub type TimeSinceEpoch = f64;
171
172
173#[derive(Debug, Clone, Serialize, Deserialize, Default)]
174#[serde(rename_all = "camelCase")]
175pub struct DragDataItem<'a> {
176 #[serde(rename = "mimeType")]
178 mime_type: Cow<'a, str>,
179 data: Cow<'a, str>,
182 #[serde(skip_serializing_if = "Option::is_none")]
184 title: Option<Cow<'a, str>>,
185 #[serde(skip_serializing_if = "Option::is_none", rename = "baseURL")]
188 base_url: Option<Cow<'a, str>>,
189}
190
191impl<'a> DragDataItem<'a> {
192 pub fn builder(mime_type: impl Into<Cow<'a, str>>, data: impl Into<Cow<'a, str>>) -> DragDataItemBuilder<'a> {
196 DragDataItemBuilder {
197 mime_type: mime_type.into(),
198 data: data.into(),
199 title: None,
200 base_url: None,
201 }
202 }
203 pub fn mime_type(&self) -> &str { self.mime_type.as_ref() }
205 pub fn data(&self) -> &str { self.data.as_ref() }
208 pub fn title(&self) -> Option<&str> { self.title.as_deref() }
210 pub fn base_url(&self) -> Option<&str> { self.base_url.as_deref() }
213}
214
215
216pub struct DragDataItemBuilder<'a> {
217 mime_type: Cow<'a, str>,
218 data: Cow<'a, str>,
219 title: Option<Cow<'a, str>>,
220 base_url: Option<Cow<'a, str>>,
221}
222
223impl<'a> DragDataItemBuilder<'a> {
224 pub fn title(mut self, title: impl Into<Cow<'a, str>>) -> Self { self.title = Some(title.into()); self }
226 pub fn base_url(mut self, base_url: impl Into<Cow<'a, str>>) -> Self { self.base_url = Some(base_url.into()); self }
229 pub fn build(self) -> DragDataItem<'a> {
230 DragDataItem {
231 mime_type: self.mime_type,
232 data: self.data,
233 title: self.title,
234 base_url: self.base_url,
235 }
236 }
237}
238
239
240#[derive(Debug, Clone, Serialize, Deserialize, Default)]
241#[serde(rename_all = "camelCase")]
242pub struct DragData<'a> {
243 items: Vec<DragDataItem<'a>>,
244 #[serde(skip_serializing_if = "Option::is_none")]
246 files: Option<Vec<Cow<'a, str>>>,
247 #[serde(rename = "dragOperationsMask")]
249 drag_operations_mask: i64,
250}
251
252impl<'a> DragData<'a> {
253 pub fn builder(items: Vec<DragDataItem<'a>>, drag_operations_mask: i64) -> DragDataBuilder<'a> {
257 DragDataBuilder {
258 items: items,
259 files: None,
260 drag_operations_mask: drag_operations_mask,
261 }
262 }
263 pub fn items(&self) -> &[DragDataItem<'a>] { &self.items }
264 pub fn files(&self) -> Option<&[Cow<'a, str>]> { self.files.as_deref() }
266 pub fn drag_operations_mask(&self) -> i64 { self.drag_operations_mask }
268}
269
270
271pub struct DragDataBuilder<'a> {
272 items: Vec<DragDataItem<'a>>,
273 files: Option<Vec<Cow<'a, str>>>,
274 drag_operations_mask: i64,
275}
276
277impl<'a> DragDataBuilder<'a> {
278 pub fn files(mut self, files: Vec<Cow<'a, str>>) -> Self { self.files = Some(files); self }
280 pub fn build(self) -> DragData<'a> {
281 DragData {
282 items: self.items,
283 files: self.files,
284 drag_operations_mask: self.drag_operations_mask,
285 }
286 }
287}
288
289#[derive(Debug, Clone, Serialize, Deserialize, Default)]
292#[serde(rename_all = "camelCase")]
293pub struct DispatchDragEventParams<'a> {
294 #[serde(rename = "type")]
296 type_: Cow<'a, str>,
297 x: f64,
299 y: f64,
302 data: DragData<'a>,
303 #[serde(skip_serializing_if = "Option::is_none")]
306 modifiers: Option<i64>,
307}
308
309impl<'a> DispatchDragEventParams<'a> {
310 pub fn builder(type_: impl Into<Cow<'a, str>>, x: f64, y: f64, data: DragData<'a>) -> DispatchDragEventParamsBuilder<'a> {
316 DispatchDragEventParamsBuilder {
317 type_: type_.into(),
318 x: x,
319 y: y,
320 data: data,
321 modifiers: None,
322 }
323 }
324 pub fn type_(&self) -> &str { self.type_.as_ref() }
326 pub fn x(&self) -> f64 { self.x }
328 pub fn y(&self) -> f64 { self.y }
331 pub fn data(&self) -> &DragData<'a> { &self.data }
332 pub fn modifiers(&self) -> Option<i64> { self.modifiers }
335}
336
337
338pub struct DispatchDragEventParamsBuilder<'a> {
339 type_: Cow<'a, str>,
340 x: f64,
341 y: f64,
342 data: DragData<'a>,
343 modifiers: Option<i64>,
344}
345
346impl<'a> DispatchDragEventParamsBuilder<'a> {
347 pub fn modifiers(mut self, modifiers: i64) -> Self { self.modifiers = Some(modifiers); self }
350 pub fn build(self) -> DispatchDragEventParams<'a> {
351 DispatchDragEventParams {
352 type_: self.type_,
353 x: self.x,
354 y: self.y,
355 data: self.data,
356 modifiers: self.modifiers,
357 }
358 }
359}
360
361impl<'a> DispatchDragEventParams<'a> { pub const METHOD: &'static str = "Input.dispatchDragEvent"; }
362
363impl<'a> crate::CdpCommand<'a> for DispatchDragEventParams<'a> {
364 const METHOD: &'static str = "Input.dispatchDragEvent";
365 type Response = crate::EmptyReturns;
366}
367
368#[derive(Debug, Clone, Serialize, Deserialize, Default)]
371#[serde(rename_all = "camelCase")]
372pub struct DispatchKeyEventParams<'a> {
373 #[serde(rename = "type")]
375 type_: Cow<'a, str>,
376 #[serde(skip_serializing_if = "Option::is_none")]
379 modifiers: Option<i64>,
380 #[serde(skip_serializing_if = "Option::is_none")]
382 timestamp: Option<TimeSinceEpoch>,
383 #[serde(skip_serializing_if = "Option::is_none")]
386 text: Option<Cow<'a, str>>,
387 #[serde(skip_serializing_if = "Option::is_none", rename = "unmodifiedText")]
390 unmodified_text: Option<Cow<'a, str>>,
391 #[serde(skip_serializing_if = "Option::is_none", rename = "keyIdentifier")]
393 key_identifier: Option<Cow<'a, str>>,
394 #[serde(skip_serializing_if = "Option::is_none")]
396 code: Option<Cow<'a, str>>,
397 #[serde(skip_serializing_if = "Option::is_none")]
400 key: Option<Cow<'a, str>>,
401 #[serde(skip_serializing_if = "Option::is_none", rename = "windowsVirtualKeyCode")]
403 windows_virtual_key_code: Option<i64>,
404 #[serde(skip_serializing_if = "Option::is_none", rename = "nativeVirtualKeyCode")]
406 native_virtual_key_code: Option<i64>,
407 #[serde(skip_serializing_if = "Option::is_none", rename = "autoRepeat")]
409 auto_repeat: Option<bool>,
410 #[serde(skip_serializing_if = "Option::is_none", rename = "isKeypad")]
412 is_keypad: Option<bool>,
413 #[serde(skip_serializing_if = "Option::is_none", rename = "isSystemKey")]
415 is_system_key: Option<bool>,
416 #[serde(skip_serializing_if = "Option::is_none")]
419 location: Option<i64>,
420 #[serde(skip_serializing_if = "Option::is_none")]
424 commands: Option<Vec<Cow<'a, str>>>,
425}
426
427impl<'a> DispatchKeyEventParams<'a> {
428 pub fn builder(type_: impl Into<Cow<'a, str>>) -> DispatchKeyEventParamsBuilder<'a> {
431 DispatchKeyEventParamsBuilder {
432 type_: type_.into(),
433 modifiers: None,
434 timestamp: None,
435 text: None,
436 unmodified_text: None,
437 key_identifier: None,
438 code: None,
439 key: None,
440 windows_virtual_key_code: None,
441 native_virtual_key_code: None,
442 auto_repeat: None,
443 is_keypad: None,
444 is_system_key: None,
445 location: None,
446 commands: None,
447 }
448 }
449 pub fn type_(&self) -> &str { self.type_.as_ref() }
451 pub fn modifiers(&self) -> Option<i64> { self.modifiers }
454 pub fn timestamp(&self) -> Option<&TimeSinceEpoch> { self.timestamp.as_ref() }
456 pub fn text(&self) -> Option<&str> { self.text.as_deref() }
459 pub fn unmodified_text(&self) -> Option<&str> { self.unmodified_text.as_deref() }
462 pub fn key_identifier(&self) -> Option<&str> { self.key_identifier.as_deref() }
464 pub fn code(&self) -> Option<&str> { self.code.as_deref() }
466 pub fn key(&self) -> Option<&str> { self.key.as_deref() }
469 pub fn windows_virtual_key_code(&self) -> Option<i64> { self.windows_virtual_key_code }
471 pub fn native_virtual_key_code(&self) -> Option<i64> { self.native_virtual_key_code }
473 pub fn auto_repeat(&self) -> Option<bool> { self.auto_repeat }
475 pub fn is_keypad(&self) -> Option<bool> { self.is_keypad }
477 pub fn is_system_key(&self) -> Option<bool> { self.is_system_key }
479 pub fn location(&self) -> Option<i64> { self.location }
482 pub fn commands(&self) -> Option<&[Cow<'a, str>]> { self.commands.as_deref() }
486}
487
488
489pub struct DispatchKeyEventParamsBuilder<'a> {
490 type_: Cow<'a, str>,
491 modifiers: Option<i64>,
492 timestamp: Option<TimeSinceEpoch>,
493 text: Option<Cow<'a, str>>,
494 unmodified_text: Option<Cow<'a, str>>,
495 key_identifier: Option<Cow<'a, str>>,
496 code: Option<Cow<'a, str>>,
497 key: Option<Cow<'a, str>>,
498 windows_virtual_key_code: Option<i64>,
499 native_virtual_key_code: Option<i64>,
500 auto_repeat: Option<bool>,
501 is_keypad: Option<bool>,
502 is_system_key: Option<bool>,
503 location: Option<i64>,
504 commands: Option<Vec<Cow<'a, str>>>,
505}
506
507impl<'a> DispatchKeyEventParamsBuilder<'a> {
508 pub fn modifiers(mut self, modifiers: i64) -> Self { self.modifiers = Some(modifiers); self }
511 pub fn timestamp(mut self, timestamp: TimeSinceEpoch) -> Self { self.timestamp = Some(timestamp); self }
513 pub fn text(mut self, text: impl Into<Cow<'a, str>>) -> Self { self.text = Some(text.into()); self }
516 pub fn unmodified_text(mut self, unmodified_text: impl Into<Cow<'a, str>>) -> Self { self.unmodified_text = Some(unmodified_text.into()); self }
519 pub fn key_identifier(mut self, key_identifier: impl Into<Cow<'a, str>>) -> Self { self.key_identifier = Some(key_identifier.into()); self }
521 pub fn code(mut self, code: impl Into<Cow<'a, str>>) -> Self { self.code = Some(code.into()); self }
523 pub fn key(mut self, key: impl Into<Cow<'a, str>>) -> Self { self.key = Some(key.into()); self }
526 pub fn windows_virtual_key_code(mut self, windows_virtual_key_code: i64) -> Self { self.windows_virtual_key_code = Some(windows_virtual_key_code); self }
528 pub fn native_virtual_key_code(mut self, native_virtual_key_code: i64) -> Self { self.native_virtual_key_code = Some(native_virtual_key_code); self }
530 pub fn auto_repeat(mut self, auto_repeat: bool) -> Self { self.auto_repeat = Some(auto_repeat); self }
532 pub fn is_keypad(mut self, is_keypad: bool) -> Self { self.is_keypad = Some(is_keypad); self }
534 pub fn is_system_key(mut self, is_system_key: bool) -> Self { self.is_system_key = Some(is_system_key); self }
536 pub fn location(mut self, location: i64) -> Self { self.location = Some(location); self }
539 pub fn commands(mut self, commands: Vec<Cow<'a, str>>) -> Self { self.commands = Some(commands); self }
543 pub fn build(self) -> DispatchKeyEventParams<'a> {
544 DispatchKeyEventParams {
545 type_: self.type_,
546 modifiers: self.modifiers,
547 timestamp: self.timestamp,
548 text: self.text,
549 unmodified_text: self.unmodified_text,
550 key_identifier: self.key_identifier,
551 code: self.code,
552 key: self.key,
553 windows_virtual_key_code: self.windows_virtual_key_code,
554 native_virtual_key_code: self.native_virtual_key_code,
555 auto_repeat: self.auto_repeat,
556 is_keypad: self.is_keypad,
557 is_system_key: self.is_system_key,
558 location: self.location,
559 commands: self.commands,
560 }
561 }
562}
563
564impl<'a> DispatchKeyEventParams<'a> { pub const METHOD: &'static str = "Input.dispatchKeyEvent"; }
565
566impl<'a> crate::CdpCommand<'a> for DispatchKeyEventParams<'a> {
567 const METHOD: &'static str = "Input.dispatchKeyEvent";
568 type Response = crate::EmptyReturns;
569}
570
571#[derive(Debug, Clone, Serialize, Deserialize, Default)]
575#[serde(rename_all = "camelCase")]
576pub struct InsertTextParams<'a> {
577 text: Cow<'a, str>,
579}
580
581impl<'a> InsertTextParams<'a> {
582 pub fn builder(text: impl Into<Cow<'a, str>>) -> InsertTextParamsBuilder<'a> {
585 InsertTextParamsBuilder {
586 text: text.into(),
587 }
588 }
589 pub fn text(&self) -> &str { self.text.as_ref() }
591}
592
593
594pub struct InsertTextParamsBuilder<'a> {
595 text: Cow<'a, str>,
596}
597
598impl<'a> InsertTextParamsBuilder<'a> {
599 pub fn build(self) -> InsertTextParams<'a> {
600 InsertTextParams {
601 text: self.text,
602 }
603 }
604}
605
606impl<'a> InsertTextParams<'a> { pub const METHOD: &'static str = "Input.insertText"; }
607
608impl<'a> crate::CdpCommand<'a> for InsertTextParams<'a> {
609 const METHOD: &'static str = "Input.insertText";
610 type Response = crate::EmptyReturns;
611}
612
613#[derive(Debug, Clone, Serialize, Deserialize, Default)]
618#[serde(rename_all = "camelCase")]
619pub struct ImeSetCompositionParams<'a> {
620 text: Cow<'a, str>,
622 #[serde(rename = "selectionStart")]
624 selection_start: i64,
625 #[serde(rename = "selectionEnd")]
627 selection_end: i64,
628 #[serde(skip_serializing_if = "Option::is_none", rename = "replacementStart")]
630 replacement_start: Option<i64>,
631 #[serde(skip_serializing_if = "Option::is_none", rename = "replacementEnd")]
633 replacement_end: Option<i64>,
634}
635
636impl<'a> ImeSetCompositionParams<'a> {
637 pub fn builder(text: impl Into<Cow<'a, str>>, selection_start: i64, selection_end: i64) -> ImeSetCompositionParamsBuilder<'a> {
642 ImeSetCompositionParamsBuilder {
643 text: text.into(),
644 selection_start: selection_start,
645 selection_end: selection_end,
646 replacement_start: None,
647 replacement_end: None,
648 }
649 }
650 pub fn text(&self) -> &str { self.text.as_ref() }
652 pub fn selection_start(&self) -> i64 { self.selection_start }
654 pub fn selection_end(&self) -> i64 { self.selection_end }
656 pub fn replacement_start(&self) -> Option<i64> { self.replacement_start }
658 pub fn replacement_end(&self) -> Option<i64> { self.replacement_end }
660}
661
662
663pub struct ImeSetCompositionParamsBuilder<'a> {
664 text: Cow<'a, str>,
665 selection_start: i64,
666 selection_end: i64,
667 replacement_start: Option<i64>,
668 replacement_end: Option<i64>,
669}
670
671impl<'a> ImeSetCompositionParamsBuilder<'a> {
672 pub fn replacement_start(mut self, replacement_start: i64) -> Self { self.replacement_start = Some(replacement_start); self }
674 pub fn replacement_end(mut self, replacement_end: i64) -> Self { self.replacement_end = Some(replacement_end); self }
676 pub fn build(self) -> ImeSetCompositionParams<'a> {
677 ImeSetCompositionParams {
678 text: self.text,
679 selection_start: self.selection_start,
680 selection_end: self.selection_end,
681 replacement_start: self.replacement_start,
682 replacement_end: self.replacement_end,
683 }
684 }
685}
686
687impl<'a> ImeSetCompositionParams<'a> { pub const METHOD: &'static str = "Input.imeSetComposition"; }
688
689impl<'a> crate::CdpCommand<'a> for ImeSetCompositionParams<'a> {
690 const METHOD: &'static str = "Input.imeSetComposition";
691 type Response = crate::EmptyReturns;
692}
693
694#[derive(Debug, Clone, Serialize, Deserialize, Default)]
697#[serde(rename_all = "camelCase")]
698pub struct DispatchMouseEventParams<'a> {
699 #[serde(rename = "type")]
701 type_: Cow<'a, str>,
702 x: f64,
704 y: f64,
707 #[serde(skip_serializing_if = "Option::is_none")]
710 modifiers: Option<i64>,
711 #[serde(skip_serializing_if = "Option::is_none")]
713 timestamp: Option<TimeSinceEpoch>,
714 #[serde(skip_serializing_if = "Option::is_none")]
716 button: Option<MouseButton>,
717 #[serde(skip_serializing_if = "Option::is_none")]
720 buttons: Option<i64>,
721 #[serde(skip_serializing_if = "Option::is_none", rename = "clickCount")]
723 click_count: Option<u64>,
724 #[serde(skip_serializing_if = "Option::is_none")]
726 force: Option<f64>,
727 #[serde(skip_serializing_if = "Option::is_none", rename = "tangentialPressure")]
729 tangential_pressure: Option<f64>,
730 #[serde(skip_serializing_if = "Option::is_none", rename = "tiltX")]
732 tilt_x: Option<f64>,
733 #[serde(skip_serializing_if = "Option::is_none", rename = "tiltY")]
735 tilt_y: Option<f64>,
736 #[serde(skip_serializing_if = "Option::is_none")]
738 twist: Option<i64>,
739 #[serde(skip_serializing_if = "Option::is_none", rename = "deltaX")]
741 delta_x: Option<f64>,
742 #[serde(skip_serializing_if = "Option::is_none", rename = "deltaY")]
744 delta_y: Option<f64>,
745 #[serde(skip_serializing_if = "Option::is_none", rename = "pointerType")]
747 pointer_type: Option<Cow<'a, str>>,
748}
749
750impl<'a> DispatchMouseEventParams<'a> {
751 pub fn builder(type_: impl Into<Cow<'a, str>>, x: f64, y: f64) -> DispatchMouseEventParamsBuilder<'a> {
756 DispatchMouseEventParamsBuilder {
757 type_: type_.into(),
758 x: x,
759 y: y,
760 modifiers: None,
761 timestamp: None,
762 button: None,
763 buttons: None,
764 click_count: None,
765 force: None,
766 tangential_pressure: None,
767 tilt_x: None,
768 tilt_y: None,
769 twist: None,
770 delta_x: None,
771 delta_y: None,
772 pointer_type: None,
773 }
774 }
775 pub fn type_(&self) -> &str { self.type_.as_ref() }
777 pub fn x(&self) -> f64 { self.x }
779 pub fn y(&self) -> f64 { self.y }
782 pub fn modifiers(&self) -> Option<i64> { self.modifiers }
785 pub fn timestamp(&self) -> Option<&TimeSinceEpoch> { self.timestamp.as_ref() }
787 pub fn button(&self) -> Option<&MouseButton> { self.button.as_ref() }
789 pub fn buttons(&self) -> Option<i64> { self.buttons }
792 pub fn click_count(&self) -> Option<u64> { self.click_count }
794 pub fn force(&self) -> Option<f64> { self.force }
796 pub fn tangential_pressure(&self) -> Option<f64> { self.tangential_pressure }
798 pub fn tilt_x(&self) -> Option<f64> { self.tilt_x }
800 pub fn tilt_y(&self) -> Option<f64> { self.tilt_y }
802 pub fn twist(&self) -> Option<i64> { self.twist }
804 pub fn delta_x(&self) -> Option<f64> { self.delta_x }
806 pub fn delta_y(&self) -> Option<f64> { self.delta_y }
808 pub fn pointer_type(&self) -> Option<&str> { self.pointer_type.as_deref() }
810}
811
812
813pub struct DispatchMouseEventParamsBuilder<'a> {
814 type_: Cow<'a, str>,
815 x: f64,
816 y: f64,
817 modifiers: Option<i64>,
818 timestamp: Option<TimeSinceEpoch>,
819 button: Option<MouseButton>,
820 buttons: Option<i64>,
821 click_count: Option<u64>,
822 force: Option<f64>,
823 tangential_pressure: Option<f64>,
824 tilt_x: Option<f64>,
825 tilt_y: Option<f64>,
826 twist: Option<i64>,
827 delta_x: Option<f64>,
828 delta_y: Option<f64>,
829 pointer_type: Option<Cow<'a, str>>,
830}
831
832impl<'a> DispatchMouseEventParamsBuilder<'a> {
833 pub fn modifiers(mut self, modifiers: i64) -> Self { self.modifiers = Some(modifiers); self }
836 pub fn timestamp(mut self, timestamp: TimeSinceEpoch) -> Self { self.timestamp = Some(timestamp); self }
838 pub fn button(mut self, button: impl Into<MouseButton>) -> Self { self.button = Some(button.into()); self }
840 pub fn buttons(mut self, buttons: i64) -> Self { self.buttons = Some(buttons); self }
843 pub fn click_count(mut self, click_count: u64) -> Self { self.click_count = Some(click_count); self }
845 pub fn force(mut self, force: f64) -> Self { self.force = Some(force); self }
847 pub fn tangential_pressure(mut self, tangential_pressure: f64) -> Self { self.tangential_pressure = Some(tangential_pressure); self }
849 pub fn tilt_x(mut self, tilt_x: f64) -> Self { self.tilt_x = Some(tilt_x); self }
851 pub fn tilt_y(mut self, tilt_y: f64) -> Self { self.tilt_y = Some(tilt_y); self }
853 pub fn twist(mut self, twist: i64) -> Self { self.twist = Some(twist); self }
855 pub fn delta_x(mut self, delta_x: f64) -> Self { self.delta_x = Some(delta_x); self }
857 pub fn delta_y(mut self, delta_y: f64) -> Self { self.delta_y = Some(delta_y); self }
859 pub fn pointer_type(mut self, pointer_type: impl Into<Cow<'a, str>>) -> Self { self.pointer_type = Some(pointer_type.into()); self }
861 pub fn build(self) -> DispatchMouseEventParams<'a> {
862 DispatchMouseEventParams {
863 type_: self.type_,
864 x: self.x,
865 y: self.y,
866 modifiers: self.modifiers,
867 timestamp: self.timestamp,
868 button: self.button,
869 buttons: self.buttons,
870 click_count: self.click_count,
871 force: self.force,
872 tangential_pressure: self.tangential_pressure,
873 tilt_x: self.tilt_x,
874 tilt_y: self.tilt_y,
875 twist: self.twist,
876 delta_x: self.delta_x,
877 delta_y: self.delta_y,
878 pointer_type: self.pointer_type,
879 }
880 }
881}
882
883impl<'a> DispatchMouseEventParams<'a> { pub const METHOD: &'static str = "Input.dispatchMouseEvent"; }
884
885impl<'a> crate::CdpCommand<'a> for DispatchMouseEventParams<'a> {
886 const METHOD: &'static str = "Input.dispatchMouseEvent";
887 type Response = crate::EmptyReturns;
888}
889
890#[derive(Debug, Clone, Serialize, Deserialize, Default)]
893#[serde(rename_all = "camelCase")]
894pub struct DispatchTouchEventParams<'a> {
895 #[serde(rename = "type")]
898 type_: Cow<'a, str>,
899 #[serde(rename = "touchPoints")]
903 touch_points: Vec<TouchPoint>,
904 #[serde(skip_serializing_if = "Option::is_none")]
907 modifiers: Option<i64>,
908 #[serde(skip_serializing_if = "Option::is_none")]
910 timestamp: Option<TimeSinceEpoch>,
911}
912
913impl<'a> DispatchTouchEventParams<'a> {
914 pub fn builder(type_: impl Into<Cow<'a, str>>, touch_points: Vec<TouchPoint>) -> DispatchTouchEventParamsBuilder<'a> {
918 DispatchTouchEventParamsBuilder {
919 type_: type_.into(),
920 touch_points: touch_points,
921 modifiers: None,
922 timestamp: None,
923 }
924 }
925 pub fn type_(&self) -> &str { self.type_.as_ref() }
928 pub fn touch_points(&self) -> &[TouchPoint] { &self.touch_points }
932 pub fn modifiers(&self) -> Option<i64> { self.modifiers }
935 pub fn timestamp(&self) -> Option<&TimeSinceEpoch> { self.timestamp.as_ref() }
937}
938
939
940pub struct DispatchTouchEventParamsBuilder<'a> {
941 type_: Cow<'a, str>,
942 touch_points: Vec<TouchPoint>,
943 modifiers: Option<i64>,
944 timestamp: Option<TimeSinceEpoch>,
945}
946
947impl<'a> DispatchTouchEventParamsBuilder<'a> {
948 pub fn modifiers(mut self, modifiers: i64) -> Self { self.modifiers = Some(modifiers); self }
951 pub fn timestamp(mut self, timestamp: TimeSinceEpoch) -> Self { self.timestamp = Some(timestamp); self }
953 pub fn build(self) -> DispatchTouchEventParams<'a> {
954 DispatchTouchEventParams {
955 type_: self.type_,
956 touch_points: self.touch_points,
957 modifiers: self.modifiers,
958 timestamp: self.timestamp,
959 }
960 }
961}
962
963impl<'a> DispatchTouchEventParams<'a> { pub const METHOD: &'static str = "Input.dispatchTouchEvent"; }
964
965impl<'a> crate::CdpCommand<'a> for DispatchTouchEventParams<'a> {
966 const METHOD: &'static str = "Input.dispatchTouchEvent";
967 type Response = crate::EmptyReturns;
968}
969
970#[derive(Debug, Clone, Serialize, Deserialize, Default)]
971pub struct CancelDraggingParams {}
972
973impl CancelDraggingParams { pub const METHOD: &'static str = "Input.cancelDragging"; }
974
975impl<'a> crate::CdpCommand<'a> for CancelDraggingParams {
976 const METHOD: &'static str = "Input.cancelDragging";
977 type Response = crate::EmptyReturns;
978}
979
980#[derive(Debug, Clone, Serialize, Deserialize, Default)]
983#[serde(rename_all = "camelCase")]
984pub struct EmulateTouchFromMouseEventParams<'a> {
985 #[serde(rename = "type")]
987 type_: Cow<'a, str>,
988 x: i32,
990 y: i32,
992 button: MouseButton,
994 #[serde(skip_serializing_if = "Option::is_none")]
996 timestamp: Option<TimeSinceEpoch>,
997 #[serde(skip_serializing_if = "Option::is_none", rename = "deltaX")]
999 delta_x: Option<f64>,
1000 #[serde(skip_serializing_if = "Option::is_none", rename = "deltaY")]
1002 delta_y: Option<f64>,
1003 #[serde(skip_serializing_if = "Option::is_none")]
1006 modifiers: Option<i64>,
1007 #[serde(skip_serializing_if = "Option::is_none", rename = "clickCount")]
1009 click_count: Option<u64>,
1010}
1011
1012impl<'a> EmulateTouchFromMouseEventParams<'a> {
1013 pub fn builder(type_: impl Into<Cow<'a, str>>, x: i32, y: i32, button: impl Into<MouseButton>) -> EmulateTouchFromMouseEventParamsBuilder<'a> {
1019 EmulateTouchFromMouseEventParamsBuilder {
1020 type_: type_.into(),
1021 x: x,
1022 y: y,
1023 button: button.into(),
1024 timestamp: None,
1025 delta_x: None,
1026 delta_y: None,
1027 modifiers: None,
1028 click_count: None,
1029 }
1030 }
1031 pub fn type_(&self) -> &str { self.type_.as_ref() }
1033 pub fn x(&self) -> i32 { self.x }
1035 pub fn y(&self) -> i32 { self.y }
1037 pub fn button(&self) -> &MouseButton { &self.button }
1039 pub fn timestamp(&self) -> Option<&TimeSinceEpoch> { self.timestamp.as_ref() }
1041 pub fn delta_x(&self) -> Option<f64> { self.delta_x }
1043 pub fn delta_y(&self) -> Option<f64> { self.delta_y }
1045 pub fn modifiers(&self) -> Option<i64> { self.modifiers }
1048 pub fn click_count(&self) -> Option<u64> { self.click_count }
1050}
1051
1052
1053pub struct EmulateTouchFromMouseEventParamsBuilder<'a> {
1054 type_: Cow<'a, str>,
1055 x: i32,
1056 y: i32,
1057 button: MouseButton,
1058 timestamp: Option<TimeSinceEpoch>,
1059 delta_x: Option<f64>,
1060 delta_y: Option<f64>,
1061 modifiers: Option<i64>,
1062 click_count: Option<u64>,
1063}
1064
1065impl<'a> EmulateTouchFromMouseEventParamsBuilder<'a> {
1066 pub fn timestamp(mut self, timestamp: TimeSinceEpoch) -> Self { self.timestamp = Some(timestamp); self }
1068 pub fn delta_x(mut self, delta_x: f64) -> Self { self.delta_x = Some(delta_x); self }
1070 pub fn delta_y(mut self, delta_y: f64) -> Self { self.delta_y = Some(delta_y); self }
1072 pub fn modifiers(mut self, modifiers: i64) -> Self { self.modifiers = Some(modifiers); self }
1075 pub fn click_count(mut self, click_count: u64) -> Self { self.click_count = Some(click_count); self }
1077 pub fn build(self) -> EmulateTouchFromMouseEventParams<'a> {
1078 EmulateTouchFromMouseEventParams {
1079 type_: self.type_,
1080 x: self.x,
1081 y: self.y,
1082 button: self.button,
1083 timestamp: self.timestamp,
1084 delta_x: self.delta_x,
1085 delta_y: self.delta_y,
1086 modifiers: self.modifiers,
1087 click_count: self.click_count,
1088 }
1089 }
1090}
1091
1092impl<'a> EmulateTouchFromMouseEventParams<'a> { pub const METHOD: &'static str = "Input.emulateTouchFromMouseEvent"; }
1093
1094impl<'a> crate::CdpCommand<'a> for EmulateTouchFromMouseEventParams<'a> {
1095 const METHOD: &'static str = "Input.emulateTouchFromMouseEvent";
1096 type Response = crate::EmptyReturns;
1097}
1098
1099#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1102#[serde(rename_all = "camelCase")]
1103pub struct SetIgnoreInputEventsParams {
1104 ignore: bool,
1106}
1107
1108impl SetIgnoreInputEventsParams {
1109 pub fn builder(ignore: bool) -> SetIgnoreInputEventsParamsBuilder {
1112 SetIgnoreInputEventsParamsBuilder {
1113 ignore: ignore,
1114 }
1115 }
1116 pub fn ignore(&self) -> bool { self.ignore }
1118}
1119
1120
1121pub struct SetIgnoreInputEventsParamsBuilder {
1122 ignore: bool,
1123}
1124
1125impl SetIgnoreInputEventsParamsBuilder {
1126 pub fn build(self) -> SetIgnoreInputEventsParams {
1127 SetIgnoreInputEventsParams {
1128 ignore: self.ignore,
1129 }
1130 }
1131}
1132
1133impl SetIgnoreInputEventsParams { pub const METHOD: &'static str = "Input.setIgnoreInputEvents"; }
1134
1135impl<'a> crate::CdpCommand<'a> for SetIgnoreInputEventsParams {
1136 const METHOD: &'static str = "Input.setIgnoreInputEvents";
1137 type Response = crate::EmptyReturns;
1138}
1139
1140#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1144#[serde(rename_all = "camelCase")]
1145pub struct SetInterceptDragsParams {
1146 enabled: bool,
1147}
1148
1149impl SetInterceptDragsParams {
1150 pub fn builder(enabled: bool) -> SetInterceptDragsParamsBuilder {
1153 SetInterceptDragsParamsBuilder {
1154 enabled: enabled,
1155 }
1156 }
1157 pub fn enabled(&self) -> bool { self.enabled }
1158}
1159
1160
1161pub struct SetInterceptDragsParamsBuilder {
1162 enabled: bool,
1163}
1164
1165impl SetInterceptDragsParamsBuilder {
1166 pub fn build(self) -> SetInterceptDragsParams {
1167 SetInterceptDragsParams {
1168 enabled: self.enabled,
1169 }
1170 }
1171}
1172
1173impl SetInterceptDragsParams { pub const METHOD: &'static str = "Input.setInterceptDrags"; }
1174
1175impl<'a> crate::CdpCommand<'a> for SetInterceptDragsParams {
1176 const METHOD: &'static str = "Input.setInterceptDrags";
1177 type Response = crate::EmptyReturns;
1178}
1179
1180#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1183#[serde(rename_all = "camelCase")]
1184pub struct SynthesizePinchGestureParams {
1185 x: f64,
1187 y: f64,
1189 #[serde(rename = "scaleFactor")]
1191 scale_factor: f64,
1192 #[serde(skip_serializing_if = "Option::is_none", rename = "relativeSpeed")]
1194 relative_speed: Option<i64>,
1195 #[serde(skip_serializing_if = "Option::is_none", rename = "gestureSourceType")]
1198 gesture_source_type: Option<GestureSourceType>,
1199}
1200
1201impl SynthesizePinchGestureParams {
1202 pub fn builder(x: f64, y: f64, scale_factor: f64) -> SynthesizePinchGestureParamsBuilder {
1207 SynthesizePinchGestureParamsBuilder {
1208 x: x,
1209 y: y,
1210 scale_factor: scale_factor,
1211 relative_speed: None,
1212 gesture_source_type: None,
1213 }
1214 }
1215 pub fn x(&self) -> f64 { self.x }
1217 pub fn y(&self) -> f64 { self.y }
1219 pub fn scale_factor(&self) -> f64 { self.scale_factor }
1221 pub fn relative_speed(&self) -> Option<i64> { self.relative_speed }
1223 pub fn gesture_source_type(&self) -> Option<&GestureSourceType> { self.gesture_source_type.as_ref() }
1226}
1227
1228
1229pub struct SynthesizePinchGestureParamsBuilder {
1230 x: f64,
1231 y: f64,
1232 scale_factor: f64,
1233 relative_speed: Option<i64>,
1234 gesture_source_type: Option<GestureSourceType>,
1235}
1236
1237impl SynthesizePinchGestureParamsBuilder {
1238 pub fn relative_speed(mut self, relative_speed: i64) -> Self { self.relative_speed = Some(relative_speed); self }
1240 pub fn gesture_source_type(mut self, gesture_source_type: impl Into<GestureSourceType>) -> Self { self.gesture_source_type = Some(gesture_source_type.into()); self }
1243 pub fn build(self) -> SynthesizePinchGestureParams {
1244 SynthesizePinchGestureParams {
1245 x: self.x,
1246 y: self.y,
1247 scale_factor: self.scale_factor,
1248 relative_speed: self.relative_speed,
1249 gesture_source_type: self.gesture_source_type,
1250 }
1251 }
1252}
1253
1254impl SynthesizePinchGestureParams { pub const METHOD: &'static str = "Input.synthesizePinchGesture"; }
1255
1256impl<'a> crate::CdpCommand<'a> for SynthesizePinchGestureParams {
1257 const METHOD: &'static str = "Input.synthesizePinchGesture";
1258 type Response = crate::EmptyReturns;
1259}
1260
1261#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1264#[serde(rename_all = "camelCase")]
1265pub struct SynthesizeScrollGestureParams<'a> {
1266 x: f64,
1268 y: f64,
1270 #[serde(skip_serializing_if = "Option::is_none", rename = "xDistance")]
1272 x_distance: Option<f64>,
1273 #[serde(skip_serializing_if = "Option::is_none", rename = "yDistance")]
1275 y_distance: Option<f64>,
1276 #[serde(skip_serializing_if = "Option::is_none", rename = "xOverscroll")]
1279 x_overscroll: Option<f64>,
1280 #[serde(skip_serializing_if = "Option::is_none", rename = "yOverscroll")]
1283 y_overscroll: Option<f64>,
1284 #[serde(skip_serializing_if = "Option::is_none", rename = "preventFling")]
1286 prevent_fling: Option<bool>,
1287 #[serde(skip_serializing_if = "Option::is_none")]
1289 speed: Option<i64>,
1290 #[serde(skip_serializing_if = "Option::is_none", rename = "gestureSourceType")]
1293 gesture_source_type: Option<GestureSourceType>,
1294 #[serde(skip_serializing_if = "Option::is_none", rename = "repeatCount")]
1296 repeat_count: Option<u64>,
1297 #[serde(skip_serializing_if = "Option::is_none", rename = "repeatDelayMs")]
1299 repeat_delay_ms: Option<i64>,
1300 #[serde(skip_serializing_if = "Option::is_none", rename = "interactionMarkerName")]
1302 interaction_marker_name: Option<Cow<'a, str>>,
1303}
1304
1305impl<'a> SynthesizeScrollGestureParams<'a> {
1306 pub fn builder(x: f64, y: f64) -> SynthesizeScrollGestureParamsBuilder<'a> {
1310 SynthesizeScrollGestureParamsBuilder {
1311 x: x,
1312 y: y,
1313 x_distance: None,
1314 y_distance: None,
1315 x_overscroll: None,
1316 y_overscroll: None,
1317 prevent_fling: None,
1318 speed: None,
1319 gesture_source_type: None,
1320 repeat_count: None,
1321 repeat_delay_ms: None,
1322 interaction_marker_name: None,
1323 }
1324 }
1325 pub fn x(&self) -> f64 { self.x }
1327 pub fn y(&self) -> f64 { self.y }
1329 pub fn x_distance(&self) -> Option<f64> { self.x_distance }
1331 pub fn y_distance(&self) -> Option<f64> { self.y_distance }
1333 pub fn x_overscroll(&self) -> Option<f64> { self.x_overscroll }
1336 pub fn y_overscroll(&self) -> Option<f64> { self.y_overscroll }
1339 pub fn prevent_fling(&self) -> Option<bool> { self.prevent_fling }
1341 pub fn speed(&self) -> Option<i64> { self.speed }
1343 pub fn gesture_source_type(&self) -> Option<&GestureSourceType> { self.gesture_source_type.as_ref() }
1346 pub fn repeat_count(&self) -> Option<u64> { self.repeat_count }
1348 pub fn repeat_delay_ms(&self) -> Option<i64> { self.repeat_delay_ms }
1350 pub fn interaction_marker_name(&self) -> Option<&str> { self.interaction_marker_name.as_deref() }
1352}
1353
1354
1355pub struct SynthesizeScrollGestureParamsBuilder<'a> {
1356 x: f64,
1357 y: f64,
1358 x_distance: Option<f64>,
1359 y_distance: Option<f64>,
1360 x_overscroll: Option<f64>,
1361 y_overscroll: Option<f64>,
1362 prevent_fling: Option<bool>,
1363 speed: Option<i64>,
1364 gesture_source_type: Option<GestureSourceType>,
1365 repeat_count: Option<u64>,
1366 repeat_delay_ms: Option<i64>,
1367 interaction_marker_name: Option<Cow<'a, str>>,
1368}
1369
1370impl<'a> SynthesizeScrollGestureParamsBuilder<'a> {
1371 pub fn x_distance(mut self, x_distance: f64) -> Self { self.x_distance = Some(x_distance); self }
1373 pub fn y_distance(mut self, y_distance: f64) -> Self { self.y_distance = Some(y_distance); self }
1375 pub fn x_overscroll(mut self, x_overscroll: f64) -> Self { self.x_overscroll = Some(x_overscroll); self }
1378 pub fn y_overscroll(mut self, y_overscroll: f64) -> Self { self.y_overscroll = Some(y_overscroll); self }
1381 pub fn prevent_fling(mut self, prevent_fling: bool) -> Self { self.prevent_fling = Some(prevent_fling); self }
1383 pub fn speed(mut self, speed: i64) -> Self { self.speed = Some(speed); self }
1385 pub fn gesture_source_type(mut self, gesture_source_type: impl Into<GestureSourceType>) -> Self { self.gesture_source_type = Some(gesture_source_type.into()); self }
1388 pub fn repeat_count(mut self, repeat_count: u64) -> Self { self.repeat_count = Some(repeat_count); self }
1390 pub fn repeat_delay_ms(mut self, repeat_delay_ms: i64) -> Self { self.repeat_delay_ms = Some(repeat_delay_ms); self }
1392 pub fn interaction_marker_name(mut self, interaction_marker_name: impl Into<Cow<'a, str>>) -> Self { self.interaction_marker_name = Some(interaction_marker_name.into()); self }
1394 pub fn build(self) -> SynthesizeScrollGestureParams<'a> {
1395 SynthesizeScrollGestureParams {
1396 x: self.x,
1397 y: self.y,
1398 x_distance: self.x_distance,
1399 y_distance: self.y_distance,
1400 x_overscroll: self.x_overscroll,
1401 y_overscroll: self.y_overscroll,
1402 prevent_fling: self.prevent_fling,
1403 speed: self.speed,
1404 gesture_source_type: self.gesture_source_type,
1405 repeat_count: self.repeat_count,
1406 repeat_delay_ms: self.repeat_delay_ms,
1407 interaction_marker_name: self.interaction_marker_name,
1408 }
1409 }
1410}
1411
1412impl<'a> SynthesizeScrollGestureParams<'a> { pub const METHOD: &'static str = "Input.synthesizeScrollGesture"; }
1413
1414impl<'a> crate::CdpCommand<'a> for SynthesizeScrollGestureParams<'a> {
1415 const METHOD: &'static str = "Input.synthesizeScrollGesture";
1416 type Response = crate::EmptyReturns;
1417}
1418
1419#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1422#[serde(rename_all = "camelCase")]
1423pub struct SynthesizeTapGestureParams {
1424 x: f64,
1426 y: f64,
1428 #[serde(skip_serializing_if = "Option::is_none")]
1430 duration: Option<i64>,
1431 #[serde(skip_serializing_if = "Option::is_none", rename = "tapCount")]
1433 tap_count: Option<u64>,
1434 #[serde(skip_serializing_if = "Option::is_none", rename = "gestureSourceType")]
1437 gesture_source_type: Option<GestureSourceType>,
1438}
1439
1440impl SynthesizeTapGestureParams {
1441 pub fn builder(x: f64, y: f64) -> SynthesizeTapGestureParamsBuilder {
1445 SynthesizeTapGestureParamsBuilder {
1446 x: x,
1447 y: y,
1448 duration: None,
1449 tap_count: None,
1450 gesture_source_type: None,
1451 }
1452 }
1453 pub fn x(&self) -> f64 { self.x }
1455 pub fn y(&self) -> f64 { self.y }
1457 pub fn duration(&self) -> Option<i64> { self.duration }
1459 pub fn tap_count(&self) -> Option<u64> { self.tap_count }
1461 pub fn gesture_source_type(&self) -> Option<&GestureSourceType> { self.gesture_source_type.as_ref() }
1464}
1465
1466
1467pub struct SynthesizeTapGestureParamsBuilder {
1468 x: f64,
1469 y: f64,
1470 duration: Option<i64>,
1471 tap_count: Option<u64>,
1472 gesture_source_type: Option<GestureSourceType>,
1473}
1474
1475impl SynthesizeTapGestureParamsBuilder {
1476 pub fn duration(mut self, duration: i64) -> Self { self.duration = Some(duration); self }
1478 pub fn tap_count(mut self, tap_count: u64) -> Self { self.tap_count = Some(tap_count); self }
1480 pub fn gesture_source_type(mut self, gesture_source_type: impl Into<GestureSourceType>) -> Self { self.gesture_source_type = Some(gesture_source_type.into()); self }
1483 pub fn build(self) -> SynthesizeTapGestureParams {
1484 SynthesizeTapGestureParams {
1485 x: self.x,
1486 y: self.y,
1487 duration: self.duration,
1488 tap_count: self.tap_count,
1489 gesture_source_type: self.gesture_source_type,
1490 }
1491 }
1492}
1493
1494impl SynthesizeTapGestureParams { pub const METHOD: &'static str = "Input.synthesizeTapGesture"; }
1495
1496impl<'a> crate::CdpCommand<'a> for SynthesizeTapGestureParams {
1497 const METHOD: &'static str = "Input.synthesizeTapGesture";
1498 type Response = crate::EmptyReturns;
1499}