1use serde::{Serialize, Deserialize};
11use serde_json::Value as JsonValue;
12use std::borrow::Cow;
13
14pub type NodeId = i64;
17
18pub type BackendNodeId = i64;
22
23pub type StyleSheetId<'a> = Cow<'a, str>;
26
27#[derive(Debug, Clone, Serialize, Deserialize, Default)]
30#[serde(rename_all = "camelCase")]
31pub struct BackendNode<'a> {
32 #[serde(rename = "nodeType")]
34 node_type: i64,
35 #[serde(rename = "nodeName")]
37 node_name: Cow<'a, str>,
38 #[serde(rename = "backendNodeId")]
39 backend_node_id: BackendNodeId,
40}
41
42impl<'a> BackendNode<'a> {
43 pub fn builder(node_type: i64, node_name: impl Into<Cow<'a, str>>, backend_node_id: BackendNodeId) -> BackendNodeBuilder<'a> {
48 BackendNodeBuilder {
49 node_type: node_type,
50 node_name: node_name.into(),
51 backend_node_id: backend_node_id,
52 }
53 }
54 pub fn node_type(&self) -> i64 { self.node_type }
56 pub fn node_name(&self) -> &str { self.node_name.as_ref() }
58 pub fn backend_node_id(&self) -> &BackendNodeId { &self.backend_node_id }
59}
60
61
62pub struct BackendNodeBuilder<'a> {
63 node_type: i64,
64 node_name: Cow<'a, str>,
65 backend_node_id: BackendNodeId,
66}
67
68impl<'a> BackendNodeBuilder<'a> {
69 pub fn build(self) -> BackendNode<'a> {
70 BackendNode {
71 node_type: self.node_type,
72 node_name: self.node_name,
73 backend_node_id: self.backend_node_id,
74 }
75 }
76}
77
78#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
81pub enum PseudoType {
82 #[default]
83 #[serde(rename = "first-line")]
84 FirstLine,
85 #[serde(rename = "first-letter")]
86 FirstLetter,
87 #[serde(rename = "checkmark")]
88 Checkmark,
89 #[serde(rename = "before")]
90 Before,
91 #[serde(rename = "after")]
92 After,
93 #[serde(rename = "expand-icon")]
94 ExpandIcon,
95 #[serde(rename = "picker-icon")]
96 PickerIcon,
97 #[serde(rename = "interest-button")]
98 InterestButton,
99 #[serde(rename = "marker")]
100 Marker,
101 #[serde(rename = "backdrop")]
102 Backdrop,
103 #[serde(rename = "column")]
104 Column,
105 #[serde(rename = "selection")]
106 Selection,
107 #[serde(rename = "search-text")]
108 SearchText,
109 #[serde(rename = "target-text")]
110 TargetText,
111 #[serde(rename = "spelling-error")]
112 SpellingError,
113 #[serde(rename = "grammar-error")]
114 GrammarError,
115 #[serde(rename = "highlight")]
116 Highlight,
117 #[serde(rename = "first-line-inherited")]
118 FirstLineInherited,
119 #[serde(rename = "scroll-marker")]
120 ScrollMarker,
121 #[serde(rename = "scroll-marker-group")]
122 ScrollMarkerGroup,
123 #[serde(rename = "scroll-button")]
124 ScrollButton,
125 #[serde(rename = "scrollbar")]
126 Scrollbar,
127 #[serde(rename = "scrollbar-thumb")]
128 ScrollbarThumb,
129 #[serde(rename = "scrollbar-button")]
130 ScrollbarButton,
131 #[serde(rename = "scrollbar-track")]
132 ScrollbarTrack,
133 #[serde(rename = "scrollbar-track-piece")]
134 ScrollbarTrackPiece,
135 #[serde(rename = "scrollbar-corner")]
136 ScrollbarCorner,
137 #[serde(rename = "resizer")]
138 Resizer,
139 #[serde(rename = "input-list-button")]
140 InputListButton,
141 #[serde(rename = "view-transition")]
142 ViewTransition,
143 #[serde(rename = "view-transition-group")]
144 ViewTransitionGroup,
145 #[serde(rename = "view-transition-image-pair")]
146 ViewTransitionImagePair,
147 #[serde(rename = "view-transition-group-children")]
148 ViewTransitionGroupChildren,
149 #[serde(rename = "view-transition-old")]
150 ViewTransitionOld,
151 #[serde(rename = "view-transition-new")]
152 ViewTransitionNew,
153 #[serde(rename = "placeholder")]
154 Placeholder,
155 #[serde(rename = "file-selector-button")]
156 FileSelectorButton,
157 #[serde(rename = "details-content")]
158 DetailsContent,
159 #[serde(rename = "picker")]
160 Picker,
161 #[serde(rename = "permission-icon")]
162 PermissionIcon,
163 #[serde(rename = "overscroll-area-parent")]
164 OverscrollAreaParent,
165}
166
167#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
170pub enum ShadowRootType {
171 #[default]
172 #[serde(rename = "user-agent")]
173 UserAgent,
174 #[serde(rename = "open")]
175 Open,
176 #[serde(rename = "closed")]
177 Closed,
178}
179
180#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
183pub enum CompatibilityMode {
184 #[default]
185 #[serde(rename = "QuirksMode")]
186 QuirksMode,
187 #[serde(rename = "LimitedQuirksMode")]
188 LimitedQuirksMode,
189 #[serde(rename = "NoQuirksMode")]
190 NoQuirksMode,
191}
192
193#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
196pub enum PhysicalAxes {
197 #[default]
198 #[serde(rename = "Horizontal")]
199 Horizontal,
200 #[serde(rename = "Vertical")]
201 Vertical,
202 #[serde(rename = "Both")]
203 Both,
204}
205
206#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
209pub enum LogicalAxes {
210 #[default]
211 #[serde(rename = "Inline")]
212 Inline,
213 #[serde(rename = "Block")]
214 Block,
215 #[serde(rename = "Both")]
216 Both,
217}
218
219#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
222pub enum ScrollOrientation {
223 #[default]
224 #[serde(rename = "horizontal")]
225 Horizontal,
226 #[serde(rename = "vertical")]
227 Vertical,
228}
229
230#[derive(Debug, Clone, Serialize, Deserialize, Default)]
234#[serde(rename_all = "camelCase")]
235pub struct Node<'a> {
236 #[serde(rename = "nodeId")]
240 node_id: NodeId,
241 #[serde(skip_serializing_if = "Option::is_none", rename = "parentId")]
243 parent_id: Option<NodeId>,
244 #[serde(rename = "backendNodeId")]
246 backend_node_id: BackendNodeId,
247 #[serde(rename = "nodeType")]
249 node_type: i64,
250 #[serde(rename = "nodeName")]
252 node_name: Cow<'a, str>,
253 #[serde(rename = "localName")]
255 local_name: Cow<'a, str>,
256 #[serde(rename = "nodeValue")]
258 node_value: Cow<'a, str>,
259 #[serde(skip_serializing_if = "Option::is_none", rename = "childNodeCount")]
261 child_node_count: Option<u64>,
262 #[serde(skip_serializing_if = "Option::is_none")]
264 children: Option<Vec<Box<Node<'a>>>>,
265 #[serde(skip_serializing_if = "Option::is_none")]
267 attributes: Option<Vec<Cow<'a, str>>>,
268 #[serde(skip_serializing_if = "Option::is_none", rename = "documentURL")]
270 document_url: Option<Cow<'a, str>>,
271 #[serde(skip_serializing_if = "Option::is_none", rename = "baseURL")]
273 base_url: Option<Cow<'a, str>>,
274 #[serde(skip_serializing_if = "Option::is_none", rename = "publicId")]
276 public_id: Option<Cow<'a, str>>,
277 #[serde(skip_serializing_if = "Option::is_none", rename = "systemId")]
279 system_id: Option<Cow<'a, str>>,
280 #[serde(skip_serializing_if = "Option::is_none", rename = "internalSubset")]
282 internal_subset: Option<Cow<'a, str>>,
283 #[serde(skip_serializing_if = "Option::is_none", rename = "xmlVersion")]
285 xml_version: Option<Cow<'a, str>>,
286 #[serde(skip_serializing_if = "Option::is_none")]
288 name: Option<Cow<'a, str>>,
289 #[serde(skip_serializing_if = "Option::is_none")]
291 value: Option<Cow<'a, str>>,
292 #[serde(skip_serializing_if = "Option::is_none", rename = "pseudoType")]
294 pseudo_type: Option<PseudoType>,
295 #[serde(skip_serializing_if = "Option::is_none", rename = "pseudoIdentifier")]
298 pseudo_identifier: Option<Cow<'a, str>>,
299 #[serde(skip_serializing_if = "Option::is_none", rename = "shadowRootType")]
301 shadow_root_type: Option<ShadowRootType>,
302 #[serde(skip_serializing_if = "Option::is_none", rename = "frameId")]
304 frame_id: Option<crate::page::FrameId<'a>>,
305 #[serde(skip_serializing_if = "Option::is_none", rename = "contentDocument")]
307 content_document: Option<Box<Node<'a>>>,
308 #[serde(skip_serializing_if = "Option::is_none", rename = "shadowRoots")]
310 shadow_roots: Option<Vec<Box<Node<'a>>>>,
311 #[serde(skip_serializing_if = "Option::is_none", rename = "templateContent")]
313 template_content: Option<Box<Node<'a>>>,
314 #[serde(skip_serializing_if = "Option::is_none", rename = "pseudoElements")]
316 pseudo_elements: Option<Vec<Box<Node<'a>>>>,
317 #[serde(skip_serializing_if = "Option::is_none", rename = "importedDocument")]
321 imported_document: Option<Box<Node<'a>>>,
322 #[serde(skip_serializing_if = "Option::is_none", rename = "distributedNodes")]
324 distributed_nodes: Option<Vec<BackendNode<'a>>>,
325 #[serde(skip_serializing_if = "Option::is_none", rename = "isSVG")]
327 is_svg: Option<bool>,
328 #[serde(skip_serializing_if = "Option::is_none", rename = "compatibilityMode")]
329 compatibility_mode: Option<CompatibilityMode>,
330 #[serde(skip_serializing_if = "Option::is_none", rename = "assignedSlot")]
331 assigned_slot: Option<BackendNode<'a>>,
332 #[serde(skip_serializing_if = "Option::is_none", rename = "isScrollable")]
333 is_scrollable: Option<bool>,
334 #[serde(skip_serializing_if = "Option::is_none", rename = "affectedByStartingStyles")]
335 affected_by_starting_styles: Option<bool>,
336 #[serde(skip_serializing_if = "Option::is_none", rename = "adoptedStyleSheets")]
337 adopted_style_sheets: Option<Vec<StyleSheetId<'a>>>,
338 #[serde(skip_serializing_if = "Option::is_none", rename = "adProvenance")]
339 ad_provenance: Option<crate::network::AdProvenance<'a>>,
340}
341
342impl<'a> Node<'a> {
343 pub fn builder(node_id: NodeId, backend_node_id: BackendNodeId, node_type: i64, node_name: impl Into<Cow<'a, str>>, local_name: impl Into<Cow<'a, str>>, node_value: impl Into<Cow<'a, str>>) -> NodeBuilder<'a> {
351 NodeBuilder {
352 node_id: node_id,
353 parent_id: None,
354 backend_node_id: backend_node_id,
355 node_type: node_type,
356 node_name: node_name.into(),
357 local_name: local_name.into(),
358 node_value: node_value.into(),
359 child_node_count: None,
360 children: None,
361 attributes: None,
362 document_url: None,
363 base_url: None,
364 public_id: None,
365 system_id: None,
366 internal_subset: None,
367 xml_version: None,
368 name: None,
369 value: None,
370 pseudo_type: None,
371 pseudo_identifier: None,
372 shadow_root_type: None,
373 frame_id: None,
374 content_document: None,
375 shadow_roots: None,
376 template_content: None,
377 pseudo_elements: None,
378 imported_document: None,
379 distributed_nodes: None,
380 is_svg: None,
381 compatibility_mode: None,
382 assigned_slot: None,
383 is_scrollable: None,
384 affected_by_starting_styles: None,
385 adopted_style_sheets: None,
386 ad_provenance: None,
387 }
388 }
389 pub fn node_id(&self) -> &NodeId { &self.node_id }
393 pub fn parent_id(&self) -> Option<&NodeId> { self.parent_id.as_ref() }
395 pub fn backend_node_id(&self) -> &BackendNodeId { &self.backend_node_id }
397 pub fn node_type(&self) -> i64 { self.node_type }
399 pub fn node_name(&self) -> &str { self.node_name.as_ref() }
401 pub fn local_name(&self) -> &str { self.local_name.as_ref() }
403 pub fn node_value(&self) -> &str { self.node_value.as_ref() }
405 pub fn child_node_count(&self) -> Option<u64> { self.child_node_count }
407 pub fn children(&self) -> Option<&[Box<Node<'a>>]> { self.children.as_deref() }
409 pub fn attributes(&self) -> Option<&[Cow<'a, str>]> { self.attributes.as_deref() }
411 pub fn document_url(&self) -> Option<&str> { self.document_url.as_deref() }
413 pub fn base_url(&self) -> Option<&str> { self.base_url.as_deref() }
415 pub fn public_id(&self) -> Option<&str> { self.public_id.as_deref() }
417 pub fn system_id(&self) -> Option<&str> { self.system_id.as_deref() }
419 pub fn internal_subset(&self) -> Option<&str> { self.internal_subset.as_deref() }
421 pub fn xml_version(&self) -> Option<&str> { self.xml_version.as_deref() }
423 pub fn name(&self) -> Option<&str> { self.name.as_deref() }
425 pub fn value(&self) -> Option<&str> { self.value.as_deref() }
427 pub fn pseudo_type(&self) -> Option<&PseudoType> { self.pseudo_type.as_ref() }
429 pub fn pseudo_identifier(&self) -> Option<&str> { self.pseudo_identifier.as_deref() }
432 pub fn shadow_root_type(&self) -> Option<&ShadowRootType> { self.shadow_root_type.as_ref() }
434 pub fn frame_id(&self) -> Option<&crate::page::FrameId<'a>> { self.frame_id.as_ref() }
436 pub fn content_document(&self) -> Option<&Node<'a>> { self.content_document.as_deref() }
438 pub fn shadow_roots(&self) -> Option<&[Box<Node<'a>>]> { self.shadow_roots.as_deref() }
440 pub fn template_content(&self) -> Option<&Node<'a>> { self.template_content.as_deref() }
442 pub fn pseudo_elements(&self) -> Option<&[Box<Node<'a>>]> { self.pseudo_elements.as_deref() }
444 pub fn imported_document(&self) -> Option<&Node<'a>> { self.imported_document.as_deref() }
448 pub fn distributed_nodes(&self) -> Option<&[BackendNode<'a>]> { self.distributed_nodes.as_deref() }
450 pub fn is_svg(&self) -> Option<bool> { self.is_svg }
452 pub fn compatibility_mode(&self) -> Option<&CompatibilityMode> { self.compatibility_mode.as_ref() }
453 pub fn assigned_slot(&self) -> Option<&BackendNode<'a>> { self.assigned_slot.as_ref() }
454 pub fn is_scrollable(&self) -> Option<bool> { self.is_scrollable }
455 pub fn affected_by_starting_styles(&self) -> Option<bool> { self.affected_by_starting_styles }
456 pub fn adopted_style_sheets(&self) -> Option<&[StyleSheetId<'a>]> { self.adopted_style_sheets.as_deref() }
457 pub fn ad_provenance(&self) -> Option<&crate::network::AdProvenance<'a>> { self.ad_provenance.as_ref() }
458}
459
460
461pub struct NodeBuilder<'a> {
462 node_id: NodeId,
463 parent_id: Option<NodeId>,
464 backend_node_id: BackendNodeId,
465 node_type: i64,
466 node_name: Cow<'a, str>,
467 local_name: Cow<'a, str>,
468 node_value: Cow<'a, str>,
469 child_node_count: Option<u64>,
470 children: Option<Vec<Box<Node<'a>>>>,
471 attributes: Option<Vec<Cow<'a, str>>>,
472 document_url: Option<Cow<'a, str>>,
473 base_url: Option<Cow<'a, str>>,
474 public_id: Option<Cow<'a, str>>,
475 system_id: Option<Cow<'a, str>>,
476 internal_subset: Option<Cow<'a, str>>,
477 xml_version: Option<Cow<'a, str>>,
478 name: Option<Cow<'a, str>>,
479 value: Option<Cow<'a, str>>,
480 pseudo_type: Option<PseudoType>,
481 pseudo_identifier: Option<Cow<'a, str>>,
482 shadow_root_type: Option<ShadowRootType>,
483 frame_id: Option<crate::page::FrameId<'a>>,
484 content_document: Option<Box<Node<'a>>>,
485 shadow_roots: Option<Vec<Box<Node<'a>>>>,
486 template_content: Option<Box<Node<'a>>>,
487 pseudo_elements: Option<Vec<Box<Node<'a>>>>,
488 imported_document: Option<Box<Node<'a>>>,
489 distributed_nodes: Option<Vec<BackendNode<'a>>>,
490 is_svg: Option<bool>,
491 compatibility_mode: Option<CompatibilityMode>,
492 assigned_slot: Option<BackendNode<'a>>,
493 is_scrollable: Option<bool>,
494 affected_by_starting_styles: Option<bool>,
495 adopted_style_sheets: Option<Vec<StyleSheetId<'a>>>,
496 ad_provenance: Option<crate::network::AdProvenance<'a>>,
497}
498
499impl<'a> NodeBuilder<'a> {
500 pub fn parent_id(mut self, parent_id: NodeId) -> Self { self.parent_id = Some(parent_id); self }
502 pub fn child_node_count(mut self, child_node_count: u64) -> Self { self.child_node_count = Some(child_node_count); self }
504 pub fn children(mut self, children: Vec<Box<Node<'a>>>) -> Self { self.children = Some(children); self }
506 pub fn attributes(mut self, attributes: Vec<Cow<'a, str>>) -> Self { self.attributes = Some(attributes); self }
508 pub fn document_url(mut self, document_url: impl Into<Cow<'a, str>>) -> Self { self.document_url = Some(document_url.into()); self }
510 pub fn base_url(mut self, base_url: impl Into<Cow<'a, str>>) -> Self { self.base_url = Some(base_url.into()); self }
512 pub fn public_id(mut self, public_id: impl Into<Cow<'a, str>>) -> Self { self.public_id = Some(public_id.into()); self }
514 pub fn system_id(mut self, system_id: impl Into<Cow<'a, str>>) -> Self { self.system_id = Some(system_id.into()); self }
516 pub fn internal_subset(mut self, internal_subset: impl Into<Cow<'a, str>>) -> Self { self.internal_subset = Some(internal_subset.into()); self }
518 pub fn xml_version(mut self, xml_version: impl Into<Cow<'a, str>>) -> Self { self.xml_version = Some(xml_version.into()); self }
520 pub fn name(mut self, name: impl Into<Cow<'a, str>>) -> Self { self.name = Some(name.into()); self }
522 pub fn value(mut self, value: impl Into<Cow<'a, str>>) -> Self { self.value = Some(value.into()); self }
524 pub fn pseudo_type(mut self, pseudo_type: impl Into<PseudoType>) -> Self { self.pseudo_type = Some(pseudo_type.into()); self }
526 pub fn pseudo_identifier(mut self, pseudo_identifier: impl Into<Cow<'a, str>>) -> Self { self.pseudo_identifier = Some(pseudo_identifier.into()); self }
529 pub fn shadow_root_type(mut self, shadow_root_type: impl Into<ShadowRootType>) -> Self { self.shadow_root_type = Some(shadow_root_type.into()); self }
531 pub fn frame_id(mut self, frame_id: crate::page::FrameId<'a>) -> Self { self.frame_id = Some(frame_id); self }
533 pub fn content_document(mut self, content_document: Box<Node<'a>>) -> Self { self.content_document = Some(content_document); self }
535 pub fn shadow_roots(mut self, shadow_roots: Vec<Box<Node<'a>>>) -> Self { self.shadow_roots = Some(shadow_roots); self }
537 pub fn template_content(mut self, template_content: Box<Node<'a>>) -> Self { self.template_content = Some(template_content); self }
539 pub fn pseudo_elements(mut self, pseudo_elements: Vec<Box<Node<'a>>>) -> Self { self.pseudo_elements = Some(pseudo_elements); self }
541 pub fn imported_document(mut self, imported_document: Box<Node<'a>>) -> Self { self.imported_document = Some(imported_document); self }
545 pub fn distributed_nodes(mut self, distributed_nodes: Vec<BackendNode<'a>>) -> Self { self.distributed_nodes = Some(distributed_nodes); self }
547 pub fn is_svg(mut self, is_svg: bool) -> Self { self.is_svg = Some(is_svg); self }
549 pub fn compatibility_mode(mut self, compatibility_mode: impl Into<CompatibilityMode>) -> Self { self.compatibility_mode = Some(compatibility_mode.into()); self }
550 pub fn assigned_slot(mut self, assigned_slot: BackendNode<'a>) -> Self { self.assigned_slot = Some(assigned_slot); self }
551 pub fn is_scrollable(mut self, is_scrollable: bool) -> Self { self.is_scrollable = Some(is_scrollable); self }
552 pub fn affected_by_starting_styles(mut self, affected_by_starting_styles: bool) -> Self { self.affected_by_starting_styles = Some(affected_by_starting_styles); self }
553 pub fn adopted_style_sheets(mut self, adopted_style_sheets: Vec<StyleSheetId<'a>>) -> Self { self.adopted_style_sheets = Some(adopted_style_sheets); self }
554 pub fn ad_provenance(mut self, ad_provenance: crate::network::AdProvenance<'a>) -> Self { self.ad_provenance = Some(ad_provenance); self }
555 pub fn build(self) -> Node<'a> {
556 Node {
557 node_id: self.node_id,
558 parent_id: self.parent_id,
559 backend_node_id: self.backend_node_id,
560 node_type: self.node_type,
561 node_name: self.node_name,
562 local_name: self.local_name,
563 node_value: self.node_value,
564 child_node_count: self.child_node_count,
565 children: self.children,
566 attributes: self.attributes,
567 document_url: self.document_url,
568 base_url: self.base_url,
569 public_id: self.public_id,
570 system_id: self.system_id,
571 internal_subset: self.internal_subset,
572 xml_version: self.xml_version,
573 name: self.name,
574 value: self.value,
575 pseudo_type: self.pseudo_type,
576 pseudo_identifier: self.pseudo_identifier,
577 shadow_root_type: self.shadow_root_type,
578 frame_id: self.frame_id,
579 content_document: self.content_document,
580 shadow_roots: self.shadow_roots,
581 template_content: self.template_content,
582 pseudo_elements: self.pseudo_elements,
583 imported_document: self.imported_document,
584 distributed_nodes: self.distributed_nodes,
585 is_svg: self.is_svg,
586 compatibility_mode: self.compatibility_mode,
587 assigned_slot: self.assigned_slot,
588 is_scrollable: self.is_scrollable,
589 affected_by_starting_styles: self.affected_by_starting_styles,
590 adopted_style_sheets: self.adopted_style_sheets,
591 ad_provenance: self.ad_provenance,
592 }
593 }
594}
595
596#[derive(Debug, Clone, Serialize, Deserialize, Default)]
599#[serde(rename_all = "camelCase")]
600pub struct DetachedElementInfo<'a> {
601 #[serde(rename = "treeNode")]
602 tree_node: Node<'a>,
603 #[serde(rename = "retainedNodeIds")]
604 retained_node_ids: Vec<NodeId>,
605}
606
607impl<'a> DetachedElementInfo<'a> {
608 pub fn builder(tree_node: Node<'a>, retained_node_ids: Vec<NodeId>) -> DetachedElementInfoBuilder<'a> {
612 DetachedElementInfoBuilder {
613 tree_node: tree_node,
614 retained_node_ids: retained_node_ids,
615 }
616 }
617 pub fn tree_node(&self) -> &Node<'a> { &self.tree_node }
618 pub fn retained_node_ids(&self) -> &[NodeId] { &self.retained_node_ids }
619}
620
621
622pub struct DetachedElementInfoBuilder<'a> {
623 tree_node: Node<'a>,
624 retained_node_ids: Vec<NodeId>,
625}
626
627impl<'a> DetachedElementInfoBuilder<'a> {
628 pub fn build(self) -> DetachedElementInfo<'a> {
629 DetachedElementInfo {
630 tree_node: self.tree_node,
631 retained_node_ids: self.retained_node_ids,
632 }
633 }
634}
635
636#[derive(Debug, Clone, Serialize, Deserialize, Default)]
639#[serde(rename_all = "camelCase")]
640pub struct RGBA {
641 r: i64,
643 g: i64,
645 b: i64,
647 #[serde(skip_serializing_if = "Option::is_none")]
649 a: Option<f64>,
650}
651
652impl RGBA {
653 pub fn builder(r: i64, g: i64, b: i64) -> RGBABuilder {
658 RGBABuilder {
659 r: r,
660 g: g,
661 b: b,
662 a: None,
663 }
664 }
665 pub fn r(&self) -> i64 { self.r }
667 pub fn g(&self) -> i64 { self.g }
669 pub fn b(&self) -> i64 { self.b }
671 pub fn a(&self) -> Option<f64> { self.a }
673}
674
675
676pub struct RGBABuilder {
677 r: i64,
678 g: i64,
679 b: i64,
680 a: Option<f64>,
681}
682
683impl RGBABuilder {
684 pub fn a(mut self, a: f64) -> Self { self.a = Some(a); self }
686 pub fn build(self) -> RGBA {
687 RGBA {
688 r: self.r,
689 g: self.g,
690 b: self.b,
691 a: self.a,
692 }
693 }
694}
695
696pub type Quad = Vec<f64>;
699
700#[derive(Debug, Clone, Serialize, Deserialize, Default)]
703#[serde(rename_all = "camelCase")]
704pub struct BoxModel {
705 content: Quad,
707 padding: Quad,
709 border: Quad,
711 margin: Quad,
713 width: u64,
715 height: i64,
717 #[serde(skip_serializing_if = "Option::is_none", rename = "shapeOutside")]
719 shape_outside: Option<ShapeOutsideInfo>,
720}
721
722impl BoxModel {
723 pub fn builder(content: Quad, padding: Quad, border: Quad, margin: Quad, width: u64, height: i64) -> BoxModelBuilder {
731 BoxModelBuilder {
732 content: content,
733 padding: padding,
734 border: border,
735 margin: margin,
736 width: width,
737 height: height,
738 shape_outside: None,
739 }
740 }
741 pub fn content(&self) -> &Quad { &self.content }
743 pub fn padding(&self) -> &Quad { &self.padding }
745 pub fn border(&self) -> &Quad { &self.border }
747 pub fn margin(&self) -> &Quad { &self.margin }
749 pub fn width(&self) -> u64 { self.width }
751 pub fn height(&self) -> i64 { self.height }
753 pub fn shape_outside(&self) -> Option<&ShapeOutsideInfo> { self.shape_outside.as_ref() }
755}
756
757
758pub struct BoxModelBuilder {
759 content: Quad,
760 padding: Quad,
761 border: Quad,
762 margin: Quad,
763 width: u64,
764 height: i64,
765 shape_outside: Option<ShapeOutsideInfo>,
766}
767
768impl BoxModelBuilder {
769 pub fn shape_outside(mut self, shape_outside: ShapeOutsideInfo) -> Self { self.shape_outside = Some(shape_outside); self }
771 pub fn build(self) -> BoxModel {
772 BoxModel {
773 content: self.content,
774 padding: self.padding,
775 border: self.border,
776 margin: self.margin,
777 width: self.width,
778 height: self.height,
779 shape_outside: self.shape_outside,
780 }
781 }
782}
783
784#[derive(Debug, Clone, Serialize, Deserialize, Default)]
787#[serde(rename_all = "camelCase")]
788pub struct ShapeOutsideInfo {
789 bounds: Quad,
791 shape: Vec<JsonValue>,
793 #[serde(rename = "marginShape")]
795 margin_shape: Vec<JsonValue>,
796}
797
798impl ShapeOutsideInfo {
799 pub fn builder(bounds: Quad, shape: Vec<JsonValue>, margin_shape: Vec<JsonValue>) -> ShapeOutsideInfoBuilder {
804 ShapeOutsideInfoBuilder {
805 bounds: bounds,
806 shape: shape,
807 margin_shape: margin_shape,
808 }
809 }
810 pub fn bounds(&self) -> &Quad { &self.bounds }
812 pub fn shape(&self) -> &[JsonValue] { &self.shape }
814 pub fn margin_shape(&self) -> &[JsonValue] { &self.margin_shape }
816}
817
818
819pub struct ShapeOutsideInfoBuilder {
820 bounds: Quad,
821 shape: Vec<JsonValue>,
822 margin_shape: Vec<JsonValue>,
823}
824
825impl ShapeOutsideInfoBuilder {
826 pub fn build(self) -> ShapeOutsideInfo {
827 ShapeOutsideInfo {
828 bounds: self.bounds,
829 shape: self.shape,
830 margin_shape: self.margin_shape,
831 }
832 }
833}
834
835#[derive(Debug, Clone, Serialize, Deserialize, Default)]
838#[serde(rename_all = "camelCase")]
839pub struct Rect {
840 x: f64,
842 y: f64,
844 width: f64,
846 height: f64,
848}
849
850impl Rect {
851 pub fn builder(x: f64, y: f64, width: f64, height: f64) -> RectBuilder {
857 RectBuilder {
858 x: x,
859 y: y,
860 width: width,
861 height: height,
862 }
863 }
864 pub fn x(&self) -> f64 { self.x }
866 pub fn y(&self) -> f64 { self.y }
868 pub fn width(&self) -> f64 { self.width }
870 pub fn height(&self) -> f64 { self.height }
872}
873
874
875pub struct RectBuilder {
876 x: f64,
877 y: f64,
878 width: f64,
879 height: f64,
880}
881
882impl RectBuilder {
883 pub fn build(self) -> Rect {
884 Rect {
885 x: self.x,
886 y: self.y,
887 width: self.width,
888 height: self.height,
889 }
890 }
891}
892
893
894#[derive(Debug, Clone, Serialize, Deserialize, Default)]
895#[serde(rename_all = "camelCase")]
896pub struct CSSComputedStyleProperty<'a> {
897 name: Cow<'a, str>,
899 value: Cow<'a, str>,
901}
902
903impl<'a> CSSComputedStyleProperty<'a> {
904 pub fn builder(name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> CSSComputedStylePropertyBuilder<'a> {
908 CSSComputedStylePropertyBuilder {
909 name: name.into(),
910 value: value.into(),
911 }
912 }
913 pub fn name(&self) -> &str { self.name.as_ref() }
915 pub fn value(&self) -> &str { self.value.as_ref() }
917}
918
919
920pub struct CSSComputedStylePropertyBuilder<'a> {
921 name: Cow<'a, str>,
922 value: Cow<'a, str>,
923}
924
925impl<'a> CSSComputedStylePropertyBuilder<'a> {
926 pub fn build(self) -> CSSComputedStyleProperty<'a> {
927 CSSComputedStyleProperty {
928 name: self.name,
929 value: self.value,
930 }
931 }
932}
933
934#[derive(Debug, Clone, Serialize, Deserialize, Default)]
937#[serde(rename_all = "camelCase")]
938pub struct CollectClassNamesFromSubtreeParams {
939 #[serde(rename = "nodeId")]
941 node_id: NodeId,
942}
943
944impl CollectClassNamesFromSubtreeParams {
945 pub fn builder(node_id: NodeId) -> CollectClassNamesFromSubtreeParamsBuilder {
948 CollectClassNamesFromSubtreeParamsBuilder {
949 node_id: node_id,
950 }
951 }
952 pub fn node_id(&self) -> &NodeId { &self.node_id }
954}
955
956
957pub struct CollectClassNamesFromSubtreeParamsBuilder {
958 node_id: NodeId,
959}
960
961impl CollectClassNamesFromSubtreeParamsBuilder {
962 pub fn build(self) -> CollectClassNamesFromSubtreeParams {
963 CollectClassNamesFromSubtreeParams {
964 node_id: self.node_id,
965 }
966 }
967}
968
969#[derive(Debug, Clone, Serialize, Deserialize, Default)]
972#[serde(rename_all = "camelCase")]
973pub struct CollectClassNamesFromSubtreeReturns<'a> {
974 #[serde(rename = "classNames")]
976 class_names: Vec<Cow<'a, str>>,
977}
978
979impl<'a> CollectClassNamesFromSubtreeReturns<'a> {
980 pub fn builder(class_names: Vec<Cow<'a, str>>) -> CollectClassNamesFromSubtreeReturnsBuilder<'a> {
983 CollectClassNamesFromSubtreeReturnsBuilder {
984 class_names: class_names,
985 }
986 }
987 pub fn class_names(&self) -> &[Cow<'a, str>] { &self.class_names }
989}
990
991
992pub struct CollectClassNamesFromSubtreeReturnsBuilder<'a> {
993 class_names: Vec<Cow<'a, str>>,
994}
995
996impl<'a> CollectClassNamesFromSubtreeReturnsBuilder<'a> {
997 pub fn build(self) -> CollectClassNamesFromSubtreeReturns<'a> {
998 CollectClassNamesFromSubtreeReturns {
999 class_names: self.class_names,
1000 }
1001 }
1002}
1003
1004impl CollectClassNamesFromSubtreeParams { pub const METHOD: &'static str = "DOM.collectClassNamesFromSubtree"; }
1005
1006impl<'a> crate::CdpCommand<'a> for CollectClassNamesFromSubtreeParams {
1007 const METHOD: &'static str = "DOM.collectClassNamesFromSubtree";
1008 type Response = CollectClassNamesFromSubtreeReturns<'a>;
1009}
1010
1011#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1015#[serde(rename_all = "camelCase")]
1016pub struct CopyToParams {
1017 #[serde(rename = "nodeId")]
1019 node_id: NodeId,
1020 #[serde(rename = "targetNodeId")]
1022 target_node_id: NodeId,
1023 #[serde(skip_serializing_if = "Option::is_none", rename = "insertBeforeNodeId")]
1026 insert_before_node_id: Option<NodeId>,
1027}
1028
1029impl CopyToParams {
1030 pub fn builder(node_id: NodeId, target_node_id: NodeId) -> CopyToParamsBuilder {
1034 CopyToParamsBuilder {
1035 node_id: node_id,
1036 target_node_id: target_node_id,
1037 insert_before_node_id: None,
1038 }
1039 }
1040 pub fn node_id(&self) -> &NodeId { &self.node_id }
1042 pub fn target_node_id(&self) -> &NodeId { &self.target_node_id }
1044 pub fn insert_before_node_id(&self) -> Option<&NodeId> { self.insert_before_node_id.as_ref() }
1047}
1048
1049
1050pub struct CopyToParamsBuilder {
1051 node_id: NodeId,
1052 target_node_id: NodeId,
1053 insert_before_node_id: Option<NodeId>,
1054}
1055
1056impl CopyToParamsBuilder {
1057 pub fn insert_before_node_id(mut self, insert_before_node_id: NodeId) -> Self { self.insert_before_node_id = Some(insert_before_node_id); self }
1060 pub fn build(self) -> CopyToParams {
1061 CopyToParams {
1062 node_id: self.node_id,
1063 target_node_id: self.target_node_id,
1064 insert_before_node_id: self.insert_before_node_id,
1065 }
1066 }
1067}
1068
1069#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1073#[serde(rename_all = "camelCase")]
1074pub struct CopyToReturns {
1075 #[serde(rename = "nodeId")]
1077 node_id: NodeId,
1078}
1079
1080impl CopyToReturns {
1081 pub fn builder(node_id: NodeId) -> CopyToReturnsBuilder {
1084 CopyToReturnsBuilder {
1085 node_id: node_id,
1086 }
1087 }
1088 pub fn node_id(&self) -> &NodeId { &self.node_id }
1090}
1091
1092
1093pub struct CopyToReturnsBuilder {
1094 node_id: NodeId,
1095}
1096
1097impl CopyToReturnsBuilder {
1098 pub fn build(self) -> CopyToReturns {
1099 CopyToReturns {
1100 node_id: self.node_id,
1101 }
1102 }
1103}
1104
1105impl CopyToParams { pub const METHOD: &'static str = "DOM.copyTo"; }
1106
1107impl<'a> crate::CdpCommand<'a> for CopyToParams {
1108 const METHOD: &'static str = "DOM.copyTo";
1109 type Response = CopyToReturns;
1110}
1111
1112#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1116#[serde(rename_all = "camelCase")]
1117pub struct DescribeNodeParams<'a> {
1118 #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
1120 node_id: Option<NodeId>,
1121 #[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
1123 backend_node_id: Option<BackendNodeId>,
1124 #[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
1126 object_id: Option<crate::runtime::RemoteObjectId<'a>>,
1127 #[serde(skip_serializing_if = "Option::is_none")]
1130 depth: Option<i64>,
1131 #[serde(skip_serializing_if = "Option::is_none")]
1134 pierce: Option<bool>,
1135}
1136
1137impl<'a> DescribeNodeParams<'a> {
1138 pub fn builder() -> DescribeNodeParamsBuilder<'a> {
1140 DescribeNodeParamsBuilder {
1141 node_id: None,
1142 backend_node_id: None,
1143 object_id: None,
1144 depth: None,
1145 pierce: None,
1146 }
1147 }
1148 pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
1150 pub fn backend_node_id(&self) -> Option<&BackendNodeId> { self.backend_node_id.as_ref() }
1152 pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
1154 pub fn depth(&self) -> Option<i64> { self.depth }
1157 pub fn pierce(&self) -> Option<bool> { self.pierce }
1160}
1161
1162#[derive(Default)]
1163pub struct DescribeNodeParamsBuilder<'a> {
1164 node_id: Option<NodeId>,
1165 backend_node_id: Option<BackendNodeId>,
1166 object_id: Option<crate::runtime::RemoteObjectId<'a>>,
1167 depth: Option<i64>,
1168 pierce: Option<bool>,
1169}
1170
1171impl<'a> DescribeNodeParamsBuilder<'a> {
1172 pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
1174 pub fn backend_node_id(mut self, backend_node_id: BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
1176 pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
1178 pub fn depth(mut self, depth: i64) -> Self { self.depth = Some(depth); self }
1181 pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
1184 pub fn build(self) -> DescribeNodeParams<'a> {
1185 DescribeNodeParams {
1186 node_id: self.node_id,
1187 backend_node_id: self.backend_node_id,
1188 object_id: self.object_id,
1189 depth: self.depth,
1190 pierce: self.pierce,
1191 }
1192 }
1193}
1194
1195#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1199#[serde(rename_all = "camelCase")]
1200pub struct DescribeNodeReturns<'a> {
1201 node: Node<'a>,
1203}
1204
1205impl<'a> DescribeNodeReturns<'a> {
1206 pub fn builder(node: Node<'a>) -> DescribeNodeReturnsBuilder<'a> {
1209 DescribeNodeReturnsBuilder {
1210 node: node,
1211 }
1212 }
1213 pub fn node(&self) -> &Node<'a> { &self.node }
1215}
1216
1217
1218pub struct DescribeNodeReturnsBuilder<'a> {
1219 node: Node<'a>,
1220}
1221
1222impl<'a> DescribeNodeReturnsBuilder<'a> {
1223 pub fn build(self) -> DescribeNodeReturns<'a> {
1224 DescribeNodeReturns {
1225 node: self.node,
1226 }
1227 }
1228}
1229
1230impl<'a> DescribeNodeParams<'a> { pub const METHOD: &'static str = "DOM.describeNode"; }
1231
1232impl<'a> crate::CdpCommand<'a> for DescribeNodeParams<'a> {
1233 const METHOD: &'static str = "DOM.describeNode";
1234 type Response = DescribeNodeReturns<'a>;
1235}
1236
1237#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1242#[serde(rename_all = "camelCase")]
1243pub struct ScrollIntoViewIfNeededParams<'a> {
1244 #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
1246 node_id: Option<NodeId>,
1247 #[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
1249 backend_node_id: Option<BackendNodeId>,
1250 #[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
1252 object_id: Option<crate::runtime::RemoteObjectId<'a>>,
1253 #[serde(skip_serializing_if = "Option::is_none")]
1256 rect: Option<Rect>,
1257}
1258
1259impl<'a> ScrollIntoViewIfNeededParams<'a> {
1260 pub fn builder() -> ScrollIntoViewIfNeededParamsBuilder<'a> {
1262 ScrollIntoViewIfNeededParamsBuilder {
1263 node_id: None,
1264 backend_node_id: None,
1265 object_id: None,
1266 rect: None,
1267 }
1268 }
1269 pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
1271 pub fn backend_node_id(&self) -> Option<&BackendNodeId> { self.backend_node_id.as_ref() }
1273 pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
1275 pub fn rect(&self) -> Option<&Rect> { self.rect.as_ref() }
1278}
1279
1280#[derive(Default)]
1281pub struct ScrollIntoViewIfNeededParamsBuilder<'a> {
1282 node_id: Option<NodeId>,
1283 backend_node_id: Option<BackendNodeId>,
1284 object_id: Option<crate::runtime::RemoteObjectId<'a>>,
1285 rect: Option<Rect>,
1286}
1287
1288impl<'a> ScrollIntoViewIfNeededParamsBuilder<'a> {
1289 pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
1291 pub fn backend_node_id(mut self, backend_node_id: BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
1293 pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
1295 pub fn rect(mut self, rect: Rect) -> Self { self.rect = Some(rect); self }
1298 pub fn build(self) -> ScrollIntoViewIfNeededParams<'a> {
1299 ScrollIntoViewIfNeededParams {
1300 node_id: self.node_id,
1301 backend_node_id: self.backend_node_id,
1302 object_id: self.object_id,
1303 rect: self.rect,
1304 }
1305 }
1306}
1307
1308impl<'a> ScrollIntoViewIfNeededParams<'a> { pub const METHOD: &'static str = "DOM.scrollIntoViewIfNeeded"; }
1309
1310impl<'a> crate::CdpCommand<'a> for ScrollIntoViewIfNeededParams<'a> {
1311 const METHOD: &'static str = "DOM.scrollIntoViewIfNeeded";
1312 type Response = crate::EmptyReturns;
1313}
1314
1315#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1316pub struct DisableParams {}
1317
1318impl DisableParams { pub const METHOD: &'static str = "DOM.disable"; }
1319
1320impl<'a> crate::CdpCommand<'a> for DisableParams {
1321 const METHOD: &'static str = "DOM.disable";
1322 type Response = crate::EmptyReturns;
1323}
1324
1325#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1329#[serde(rename_all = "camelCase")]
1330pub struct DiscardSearchResultsParams<'a> {
1331 #[serde(rename = "searchId")]
1333 search_id: Cow<'a, str>,
1334}
1335
1336impl<'a> DiscardSearchResultsParams<'a> {
1337 pub fn builder(search_id: impl Into<Cow<'a, str>>) -> DiscardSearchResultsParamsBuilder<'a> {
1340 DiscardSearchResultsParamsBuilder {
1341 search_id: search_id.into(),
1342 }
1343 }
1344 pub fn search_id(&self) -> &str { self.search_id.as_ref() }
1346}
1347
1348
1349pub struct DiscardSearchResultsParamsBuilder<'a> {
1350 search_id: Cow<'a, str>,
1351}
1352
1353impl<'a> DiscardSearchResultsParamsBuilder<'a> {
1354 pub fn build(self) -> DiscardSearchResultsParams<'a> {
1355 DiscardSearchResultsParams {
1356 search_id: self.search_id,
1357 }
1358 }
1359}
1360
1361impl<'a> DiscardSearchResultsParams<'a> { pub const METHOD: &'static str = "DOM.discardSearchResults"; }
1362
1363impl<'a> crate::CdpCommand<'a> for DiscardSearchResultsParams<'a> {
1364 const METHOD: &'static str = "DOM.discardSearchResults";
1365 type Response = crate::EmptyReturns;
1366}
1367
1368#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1371#[serde(rename_all = "camelCase")]
1372pub struct EnableParams<'a> {
1373 #[serde(skip_serializing_if = "Option::is_none", rename = "includeWhitespace")]
1375 include_whitespace: Option<Cow<'a, str>>,
1376}
1377
1378impl<'a> EnableParams<'a> {
1379 pub fn builder() -> EnableParamsBuilder<'a> {
1381 EnableParamsBuilder {
1382 include_whitespace: None,
1383 }
1384 }
1385 pub fn include_whitespace(&self) -> Option<&str> { self.include_whitespace.as_deref() }
1387}
1388
1389#[derive(Default)]
1390pub struct EnableParamsBuilder<'a> {
1391 include_whitespace: Option<Cow<'a, str>>,
1392}
1393
1394impl<'a> EnableParamsBuilder<'a> {
1395 pub fn include_whitespace(mut self, include_whitespace: impl Into<Cow<'a, str>>) -> Self { self.include_whitespace = Some(include_whitespace.into()); self }
1397 pub fn build(self) -> EnableParams<'a> {
1398 EnableParams {
1399 include_whitespace: self.include_whitespace,
1400 }
1401 }
1402}
1403
1404impl<'a> EnableParams<'a> { pub const METHOD: &'static str = "DOM.enable"; }
1405
1406impl<'a> crate::CdpCommand<'a> for EnableParams<'a> {
1407 const METHOD: &'static str = "DOM.enable";
1408 type Response = crate::EmptyReturns;
1409}
1410
1411#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1414#[serde(rename_all = "camelCase")]
1415pub struct FocusParams<'a> {
1416 #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
1418 node_id: Option<NodeId>,
1419 #[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
1421 backend_node_id: Option<BackendNodeId>,
1422 #[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
1424 object_id: Option<crate::runtime::RemoteObjectId<'a>>,
1425}
1426
1427impl<'a> FocusParams<'a> {
1428 pub fn builder() -> FocusParamsBuilder<'a> {
1430 FocusParamsBuilder {
1431 node_id: None,
1432 backend_node_id: None,
1433 object_id: None,
1434 }
1435 }
1436 pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
1438 pub fn backend_node_id(&self) -> Option<&BackendNodeId> { self.backend_node_id.as_ref() }
1440 pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
1442}
1443
1444#[derive(Default)]
1445pub struct FocusParamsBuilder<'a> {
1446 node_id: Option<NodeId>,
1447 backend_node_id: Option<BackendNodeId>,
1448 object_id: Option<crate::runtime::RemoteObjectId<'a>>,
1449}
1450
1451impl<'a> FocusParamsBuilder<'a> {
1452 pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
1454 pub fn backend_node_id(mut self, backend_node_id: BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
1456 pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
1458 pub fn build(self) -> FocusParams<'a> {
1459 FocusParams {
1460 node_id: self.node_id,
1461 backend_node_id: self.backend_node_id,
1462 object_id: self.object_id,
1463 }
1464 }
1465}
1466
1467impl<'a> FocusParams<'a> { pub const METHOD: &'static str = "DOM.focus"; }
1468
1469impl<'a> crate::CdpCommand<'a> for FocusParams<'a> {
1470 const METHOD: &'static str = "DOM.focus";
1471 type Response = crate::EmptyReturns;
1472}
1473
1474#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1477#[serde(rename_all = "camelCase")]
1478pub struct GetAttributesParams {
1479 #[serde(rename = "nodeId")]
1481 node_id: NodeId,
1482}
1483
1484impl GetAttributesParams {
1485 pub fn builder(node_id: NodeId) -> GetAttributesParamsBuilder {
1488 GetAttributesParamsBuilder {
1489 node_id: node_id,
1490 }
1491 }
1492 pub fn node_id(&self) -> &NodeId { &self.node_id }
1494}
1495
1496
1497pub struct GetAttributesParamsBuilder {
1498 node_id: NodeId,
1499}
1500
1501impl GetAttributesParamsBuilder {
1502 pub fn build(self) -> GetAttributesParams {
1503 GetAttributesParams {
1504 node_id: self.node_id,
1505 }
1506 }
1507}
1508
1509#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1512#[serde(rename_all = "camelCase")]
1513pub struct GetAttributesReturns<'a> {
1514 attributes: Vec<Cow<'a, str>>,
1516}
1517
1518impl<'a> GetAttributesReturns<'a> {
1519 pub fn builder(attributes: Vec<Cow<'a, str>>) -> GetAttributesReturnsBuilder<'a> {
1522 GetAttributesReturnsBuilder {
1523 attributes: attributes,
1524 }
1525 }
1526 pub fn attributes(&self) -> &[Cow<'a, str>] { &self.attributes }
1528}
1529
1530
1531pub struct GetAttributesReturnsBuilder<'a> {
1532 attributes: Vec<Cow<'a, str>>,
1533}
1534
1535impl<'a> GetAttributesReturnsBuilder<'a> {
1536 pub fn build(self) -> GetAttributesReturns<'a> {
1537 GetAttributesReturns {
1538 attributes: self.attributes,
1539 }
1540 }
1541}
1542
1543impl GetAttributesParams { pub const METHOD: &'static str = "DOM.getAttributes"; }
1544
1545impl<'a> crate::CdpCommand<'a> for GetAttributesParams {
1546 const METHOD: &'static str = "DOM.getAttributes";
1547 type Response = GetAttributesReturns<'a>;
1548}
1549
1550#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1553#[serde(rename_all = "camelCase")]
1554pub struct GetBoxModelParams<'a> {
1555 #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
1557 node_id: Option<NodeId>,
1558 #[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
1560 backend_node_id: Option<BackendNodeId>,
1561 #[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
1563 object_id: Option<crate::runtime::RemoteObjectId<'a>>,
1564}
1565
1566impl<'a> GetBoxModelParams<'a> {
1567 pub fn builder() -> GetBoxModelParamsBuilder<'a> {
1569 GetBoxModelParamsBuilder {
1570 node_id: None,
1571 backend_node_id: None,
1572 object_id: None,
1573 }
1574 }
1575 pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
1577 pub fn backend_node_id(&self) -> Option<&BackendNodeId> { self.backend_node_id.as_ref() }
1579 pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
1581}
1582
1583#[derive(Default)]
1584pub struct GetBoxModelParamsBuilder<'a> {
1585 node_id: Option<NodeId>,
1586 backend_node_id: Option<BackendNodeId>,
1587 object_id: Option<crate::runtime::RemoteObjectId<'a>>,
1588}
1589
1590impl<'a> GetBoxModelParamsBuilder<'a> {
1591 pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
1593 pub fn backend_node_id(mut self, backend_node_id: BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
1595 pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
1597 pub fn build(self) -> GetBoxModelParams<'a> {
1598 GetBoxModelParams {
1599 node_id: self.node_id,
1600 backend_node_id: self.backend_node_id,
1601 object_id: self.object_id,
1602 }
1603 }
1604}
1605
1606#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1609#[serde(rename_all = "camelCase")]
1610pub struct GetBoxModelReturns {
1611 model: BoxModel,
1613}
1614
1615impl GetBoxModelReturns {
1616 pub fn builder(model: BoxModel) -> GetBoxModelReturnsBuilder {
1619 GetBoxModelReturnsBuilder {
1620 model: model,
1621 }
1622 }
1623 pub fn model(&self) -> &BoxModel { &self.model }
1625}
1626
1627
1628pub struct GetBoxModelReturnsBuilder {
1629 model: BoxModel,
1630}
1631
1632impl GetBoxModelReturnsBuilder {
1633 pub fn build(self) -> GetBoxModelReturns {
1634 GetBoxModelReturns {
1635 model: self.model,
1636 }
1637 }
1638}
1639
1640impl<'a> GetBoxModelParams<'a> { pub const METHOD: &'static str = "DOM.getBoxModel"; }
1641
1642impl<'a> crate::CdpCommand<'a> for GetBoxModelParams<'a> {
1643 const METHOD: &'static str = "DOM.getBoxModel";
1644 type Response = GetBoxModelReturns;
1645}
1646
1647#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1651#[serde(rename_all = "camelCase")]
1652pub struct GetContentQuadsParams<'a> {
1653 #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
1655 node_id: Option<NodeId>,
1656 #[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
1658 backend_node_id: Option<BackendNodeId>,
1659 #[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
1661 object_id: Option<crate::runtime::RemoteObjectId<'a>>,
1662}
1663
1664impl<'a> GetContentQuadsParams<'a> {
1665 pub fn builder() -> GetContentQuadsParamsBuilder<'a> {
1667 GetContentQuadsParamsBuilder {
1668 node_id: None,
1669 backend_node_id: None,
1670 object_id: None,
1671 }
1672 }
1673 pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
1675 pub fn backend_node_id(&self) -> Option<&BackendNodeId> { self.backend_node_id.as_ref() }
1677 pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
1679}
1680
1681#[derive(Default)]
1682pub struct GetContentQuadsParamsBuilder<'a> {
1683 node_id: Option<NodeId>,
1684 backend_node_id: Option<BackendNodeId>,
1685 object_id: Option<crate::runtime::RemoteObjectId<'a>>,
1686}
1687
1688impl<'a> GetContentQuadsParamsBuilder<'a> {
1689 pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
1691 pub fn backend_node_id(mut self, backend_node_id: BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
1693 pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
1695 pub fn build(self) -> GetContentQuadsParams<'a> {
1696 GetContentQuadsParams {
1697 node_id: self.node_id,
1698 backend_node_id: self.backend_node_id,
1699 object_id: self.object_id,
1700 }
1701 }
1702}
1703
1704#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1708#[serde(rename_all = "camelCase")]
1709pub struct GetContentQuadsReturns {
1710 quads: Vec<Quad>,
1712}
1713
1714impl GetContentQuadsReturns {
1715 pub fn builder(quads: Vec<Quad>) -> GetContentQuadsReturnsBuilder {
1718 GetContentQuadsReturnsBuilder {
1719 quads: quads,
1720 }
1721 }
1722 pub fn quads(&self) -> &[Quad] { &self.quads }
1724}
1725
1726
1727pub struct GetContentQuadsReturnsBuilder {
1728 quads: Vec<Quad>,
1729}
1730
1731impl GetContentQuadsReturnsBuilder {
1732 pub fn build(self) -> GetContentQuadsReturns {
1733 GetContentQuadsReturns {
1734 quads: self.quads,
1735 }
1736 }
1737}
1738
1739impl<'a> GetContentQuadsParams<'a> { pub const METHOD: &'static str = "DOM.getContentQuads"; }
1740
1741impl<'a> crate::CdpCommand<'a> for GetContentQuadsParams<'a> {
1742 const METHOD: &'static str = "DOM.getContentQuads";
1743 type Response = GetContentQuadsReturns;
1744}
1745
1746#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1750#[serde(rename_all = "camelCase")]
1751pub struct GetDocumentParams {
1752 #[serde(skip_serializing_if = "Option::is_none")]
1755 depth: Option<i64>,
1756 #[serde(skip_serializing_if = "Option::is_none")]
1759 pierce: Option<bool>,
1760}
1761
1762impl GetDocumentParams {
1763 pub fn builder() -> GetDocumentParamsBuilder {
1765 GetDocumentParamsBuilder {
1766 depth: None,
1767 pierce: None,
1768 }
1769 }
1770 pub fn depth(&self) -> Option<i64> { self.depth }
1773 pub fn pierce(&self) -> Option<bool> { self.pierce }
1776}
1777
1778#[derive(Default)]
1779pub struct GetDocumentParamsBuilder {
1780 depth: Option<i64>,
1781 pierce: Option<bool>,
1782}
1783
1784impl GetDocumentParamsBuilder {
1785 pub fn depth(mut self, depth: i64) -> Self { self.depth = Some(depth); self }
1788 pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
1791 pub fn build(self) -> GetDocumentParams {
1792 GetDocumentParams {
1793 depth: self.depth,
1794 pierce: self.pierce,
1795 }
1796 }
1797}
1798
1799#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1803#[serde(rename_all = "camelCase")]
1804pub struct GetDocumentReturns<'a> {
1805 root: Node<'a>,
1807}
1808
1809impl<'a> GetDocumentReturns<'a> {
1810 pub fn builder(root: Node<'a>) -> GetDocumentReturnsBuilder<'a> {
1813 GetDocumentReturnsBuilder {
1814 root: root,
1815 }
1816 }
1817 pub fn root(&self) -> &Node<'a> { &self.root }
1819}
1820
1821
1822pub struct GetDocumentReturnsBuilder<'a> {
1823 root: Node<'a>,
1824}
1825
1826impl<'a> GetDocumentReturnsBuilder<'a> {
1827 pub fn build(self) -> GetDocumentReturns<'a> {
1828 GetDocumentReturns {
1829 root: self.root,
1830 }
1831 }
1832}
1833
1834impl GetDocumentParams { pub const METHOD: &'static str = "DOM.getDocument"; }
1835
1836impl<'a> crate::CdpCommand<'a> for GetDocumentParams {
1837 const METHOD: &'static str = "DOM.getDocument";
1838 type Response = GetDocumentReturns<'a>;
1839}
1840
1841#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1846#[serde(rename_all = "camelCase")]
1847pub struct GetFlattenedDocumentParams {
1848 #[serde(skip_serializing_if = "Option::is_none")]
1851 depth: Option<i64>,
1852 #[serde(skip_serializing_if = "Option::is_none")]
1855 pierce: Option<bool>,
1856}
1857
1858impl GetFlattenedDocumentParams {
1859 pub fn builder() -> GetFlattenedDocumentParamsBuilder {
1861 GetFlattenedDocumentParamsBuilder {
1862 depth: None,
1863 pierce: None,
1864 }
1865 }
1866 pub fn depth(&self) -> Option<i64> { self.depth }
1869 pub fn pierce(&self) -> Option<bool> { self.pierce }
1872}
1873
1874#[derive(Default)]
1875pub struct GetFlattenedDocumentParamsBuilder {
1876 depth: Option<i64>,
1877 pierce: Option<bool>,
1878}
1879
1880impl GetFlattenedDocumentParamsBuilder {
1881 pub fn depth(mut self, depth: i64) -> Self { self.depth = Some(depth); self }
1884 pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
1887 pub fn build(self) -> GetFlattenedDocumentParams {
1888 GetFlattenedDocumentParams {
1889 depth: self.depth,
1890 pierce: self.pierce,
1891 }
1892 }
1893}
1894
1895#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1900#[serde(rename_all = "camelCase")]
1901pub struct GetFlattenedDocumentReturns<'a> {
1902 nodes: Vec<Node<'a>>,
1904}
1905
1906impl<'a> GetFlattenedDocumentReturns<'a> {
1907 pub fn builder(nodes: Vec<Node<'a>>) -> GetFlattenedDocumentReturnsBuilder<'a> {
1910 GetFlattenedDocumentReturnsBuilder {
1911 nodes: nodes,
1912 }
1913 }
1914 pub fn nodes(&self) -> &[Node<'a>] { &self.nodes }
1916}
1917
1918
1919pub struct GetFlattenedDocumentReturnsBuilder<'a> {
1920 nodes: Vec<Node<'a>>,
1921}
1922
1923impl<'a> GetFlattenedDocumentReturnsBuilder<'a> {
1924 pub fn build(self) -> GetFlattenedDocumentReturns<'a> {
1925 GetFlattenedDocumentReturns {
1926 nodes: self.nodes,
1927 }
1928 }
1929}
1930
1931impl GetFlattenedDocumentParams { pub const METHOD: &'static str = "DOM.getFlattenedDocument"; }
1932
1933impl<'a> crate::CdpCommand<'a> for GetFlattenedDocumentParams {
1934 const METHOD: &'static str = "DOM.getFlattenedDocument";
1935 type Response = GetFlattenedDocumentReturns<'a>;
1936}
1937
1938#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1941#[serde(rename_all = "camelCase")]
1942pub struct GetNodesForSubtreeByStyleParams<'a> {
1943 #[serde(rename = "nodeId")]
1945 node_id: NodeId,
1946 #[serde(rename = "computedStyles")]
1948 computed_styles: Vec<CSSComputedStyleProperty<'a>>,
1949 #[serde(skip_serializing_if = "Option::is_none")]
1952 pierce: Option<bool>,
1953}
1954
1955impl<'a> GetNodesForSubtreeByStyleParams<'a> {
1956 pub fn builder(node_id: NodeId, computed_styles: Vec<CSSComputedStyleProperty<'a>>) -> GetNodesForSubtreeByStyleParamsBuilder<'a> {
1960 GetNodesForSubtreeByStyleParamsBuilder {
1961 node_id: node_id,
1962 computed_styles: computed_styles,
1963 pierce: None,
1964 }
1965 }
1966 pub fn node_id(&self) -> &NodeId { &self.node_id }
1968 pub fn computed_styles(&self) -> &[CSSComputedStyleProperty<'a>] { &self.computed_styles }
1970 pub fn pierce(&self) -> Option<bool> { self.pierce }
1973}
1974
1975
1976pub struct GetNodesForSubtreeByStyleParamsBuilder<'a> {
1977 node_id: NodeId,
1978 computed_styles: Vec<CSSComputedStyleProperty<'a>>,
1979 pierce: Option<bool>,
1980}
1981
1982impl<'a> GetNodesForSubtreeByStyleParamsBuilder<'a> {
1983 pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
1986 pub fn build(self) -> GetNodesForSubtreeByStyleParams<'a> {
1987 GetNodesForSubtreeByStyleParams {
1988 node_id: self.node_id,
1989 computed_styles: self.computed_styles,
1990 pierce: self.pierce,
1991 }
1992 }
1993}
1994
1995#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1998#[serde(rename_all = "camelCase")]
1999pub struct GetNodesForSubtreeByStyleReturns {
2000 #[serde(rename = "nodeIds")]
2002 node_ids: Vec<NodeId>,
2003}
2004
2005impl GetNodesForSubtreeByStyleReturns {
2006 pub fn builder(node_ids: Vec<NodeId>) -> GetNodesForSubtreeByStyleReturnsBuilder {
2009 GetNodesForSubtreeByStyleReturnsBuilder {
2010 node_ids: node_ids,
2011 }
2012 }
2013 pub fn node_ids(&self) -> &[NodeId] { &self.node_ids }
2015}
2016
2017
2018pub struct GetNodesForSubtreeByStyleReturnsBuilder {
2019 node_ids: Vec<NodeId>,
2020}
2021
2022impl GetNodesForSubtreeByStyleReturnsBuilder {
2023 pub fn build(self) -> GetNodesForSubtreeByStyleReturns {
2024 GetNodesForSubtreeByStyleReturns {
2025 node_ids: self.node_ids,
2026 }
2027 }
2028}
2029
2030impl<'a> GetNodesForSubtreeByStyleParams<'a> { pub const METHOD: &'static str = "DOM.getNodesForSubtreeByStyle"; }
2031
2032impl<'a> crate::CdpCommand<'a> for GetNodesForSubtreeByStyleParams<'a> {
2033 const METHOD: &'static str = "DOM.getNodesForSubtreeByStyle";
2034 type Response = GetNodesForSubtreeByStyleReturns;
2035}
2036
2037#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2041#[serde(rename_all = "camelCase")]
2042pub struct GetNodeForLocationParams {
2043 x: i32,
2045 y: i32,
2047 #[serde(skip_serializing_if = "Option::is_none", rename = "includeUserAgentShadowDOM")]
2049 include_user_agent_shadow_dom: Option<bool>,
2050 #[serde(skip_serializing_if = "Option::is_none", rename = "ignorePointerEventsNone")]
2052 ignore_pointer_events_none: Option<bool>,
2053}
2054
2055impl GetNodeForLocationParams {
2056 pub fn builder(x: i32, y: i32) -> GetNodeForLocationParamsBuilder {
2060 GetNodeForLocationParamsBuilder {
2061 x: x,
2062 y: y,
2063 include_user_agent_shadow_dom: None,
2064 ignore_pointer_events_none: None,
2065 }
2066 }
2067 pub fn x(&self) -> i32 { self.x }
2069 pub fn y(&self) -> i32 { self.y }
2071 pub fn include_user_agent_shadow_dom(&self) -> Option<bool> { self.include_user_agent_shadow_dom }
2073 pub fn ignore_pointer_events_none(&self) -> Option<bool> { self.ignore_pointer_events_none }
2075}
2076
2077
2078pub struct GetNodeForLocationParamsBuilder {
2079 x: i32,
2080 y: i32,
2081 include_user_agent_shadow_dom: Option<bool>,
2082 ignore_pointer_events_none: Option<bool>,
2083}
2084
2085impl GetNodeForLocationParamsBuilder {
2086 pub fn include_user_agent_shadow_dom(mut self, include_user_agent_shadow_dom: bool) -> Self { self.include_user_agent_shadow_dom = Some(include_user_agent_shadow_dom); self }
2088 pub fn ignore_pointer_events_none(mut self, ignore_pointer_events_none: bool) -> Self { self.ignore_pointer_events_none = Some(ignore_pointer_events_none); self }
2090 pub fn build(self) -> GetNodeForLocationParams {
2091 GetNodeForLocationParams {
2092 x: self.x,
2093 y: self.y,
2094 include_user_agent_shadow_dom: self.include_user_agent_shadow_dom,
2095 ignore_pointer_events_none: self.ignore_pointer_events_none,
2096 }
2097 }
2098}
2099
2100#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2104#[serde(rename_all = "camelCase")]
2105pub struct GetNodeForLocationReturns<'a> {
2106 #[serde(rename = "backendNodeId")]
2108 backend_node_id: BackendNodeId,
2109 #[serde(rename = "frameId")]
2111 frame_id: crate::page::FrameId<'a>,
2112 #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
2114 node_id: Option<NodeId>,
2115}
2116
2117impl<'a> GetNodeForLocationReturns<'a> {
2118 pub fn builder(backend_node_id: BackendNodeId, frame_id: crate::page::FrameId<'a>) -> GetNodeForLocationReturnsBuilder<'a> {
2122 GetNodeForLocationReturnsBuilder {
2123 backend_node_id: backend_node_id,
2124 frame_id: frame_id,
2125 node_id: None,
2126 }
2127 }
2128 pub fn backend_node_id(&self) -> &BackendNodeId { &self.backend_node_id }
2130 pub fn frame_id(&self) -> &crate::page::FrameId<'a> { &self.frame_id }
2132 pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
2134}
2135
2136
2137pub struct GetNodeForLocationReturnsBuilder<'a> {
2138 backend_node_id: BackendNodeId,
2139 frame_id: crate::page::FrameId<'a>,
2140 node_id: Option<NodeId>,
2141}
2142
2143impl<'a> GetNodeForLocationReturnsBuilder<'a> {
2144 pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
2146 pub fn build(self) -> GetNodeForLocationReturns<'a> {
2147 GetNodeForLocationReturns {
2148 backend_node_id: self.backend_node_id,
2149 frame_id: self.frame_id,
2150 node_id: self.node_id,
2151 }
2152 }
2153}
2154
2155impl GetNodeForLocationParams { pub const METHOD: &'static str = "DOM.getNodeForLocation"; }
2156
2157impl<'a> crate::CdpCommand<'a> for GetNodeForLocationParams {
2158 const METHOD: &'static str = "DOM.getNodeForLocation";
2159 type Response = GetNodeForLocationReturns<'a>;
2160}
2161
2162#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2165#[serde(rename_all = "camelCase")]
2166pub struct GetOuterHTMLParams<'a> {
2167 #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
2169 node_id: Option<NodeId>,
2170 #[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
2172 backend_node_id: Option<BackendNodeId>,
2173 #[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
2175 object_id: Option<crate::runtime::RemoteObjectId<'a>>,
2176 #[serde(skip_serializing_if = "Option::is_none", rename = "includeShadowDOM")]
2178 include_shadow_dom: Option<bool>,
2179}
2180
2181impl<'a> GetOuterHTMLParams<'a> {
2182 pub fn builder() -> GetOuterHTMLParamsBuilder<'a> {
2184 GetOuterHTMLParamsBuilder {
2185 node_id: None,
2186 backend_node_id: None,
2187 object_id: None,
2188 include_shadow_dom: None,
2189 }
2190 }
2191 pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
2193 pub fn backend_node_id(&self) -> Option<&BackendNodeId> { self.backend_node_id.as_ref() }
2195 pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
2197 pub fn include_shadow_dom(&self) -> Option<bool> { self.include_shadow_dom }
2199}
2200
2201#[derive(Default)]
2202pub struct GetOuterHTMLParamsBuilder<'a> {
2203 node_id: Option<NodeId>,
2204 backend_node_id: Option<BackendNodeId>,
2205 object_id: Option<crate::runtime::RemoteObjectId<'a>>,
2206 include_shadow_dom: Option<bool>,
2207}
2208
2209impl<'a> GetOuterHTMLParamsBuilder<'a> {
2210 pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
2212 pub fn backend_node_id(mut self, backend_node_id: BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
2214 pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
2216 pub fn include_shadow_dom(mut self, include_shadow_dom: bool) -> Self { self.include_shadow_dom = Some(include_shadow_dom); self }
2218 pub fn build(self) -> GetOuterHTMLParams<'a> {
2219 GetOuterHTMLParams {
2220 node_id: self.node_id,
2221 backend_node_id: self.backend_node_id,
2222 object_id: self.object_id,
2223 include_shadow_dom: self.include_shadow_dom,
2224 }
2225 }
2226}
2227
2228#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2231#[serde(rename_all = "camelCase")]
2232pub struct GetOuterHTMLReturns<'a> {
2233 #[serde(rename = "outerHTML")]
2235 outer_html: Cow<'a, str>,
2236}
2237
2238impl<'a> GetOuterHTMLReturns<'a> {
2239 pub fn builder(outer_html: impl Into<Cow<'a, str>>) -> GetOuterHTMLReturnsBuilder<'a> {
2242 GetOuterHTMLReturnsBuilder {
2243 outer_html: outer_html.into(),
2244 }
2245 }
2246 pub fn outer_html(&self) -> &str { self.outer_html.as_ref() }
2248}
2249
2250
2251pub struct GetOuterHTMLReturnsBuilder<'a> {
2252 outer_html: Cow<'a, str>,
2253}
2254
2255impl<'a> GetOuterHTMLReturnsBuilder<'a> {
2256 pub fn build(self) -> GetOuterHTMLReturns<'a> {
2257 GetOuterHTMLReturns {
2258 outer_html: self.outer_html,
2259 }
2260 }
2261}
2262
2263impl<'a> GetOuterHTMLParams<'a> { pub const METHOD: &'static str = "DOM.getOuterHTML"; }
2264
2265impl<'a> crate::CdpCommand<'a> for GetOuterHTMLParams<'a> {
2266 const METHOD: &'static str = "DOM.getOuterHTML";
2267 type Response = GetOuterHTMLReturns<'a>;
2268}
2269
2270#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2273#[serde(rename_all = "camelCase")]
2274pub struct GetRelayoutBoundaryParams {
2275 #[serde(rename = "nodeId")]
2277 node_id: NodeId,
2278}
2279
2280impl GetRelayoutBoundaryParams {
2281 pub fn builder(node_id: NodeId) -> GetRelayoutBoundaryParamsBuilder {
2284 GetRelayoutBoundaryParamsBuilder {
2285 node_id: node_id,
2286 }
2287 }
2288 pub fn node_id(&self) -> &NodeId { &self.node_id }
2290}
2291
2292
2293pub struct GetRelayoutBoundaryParamsBuilder {
2294 node_id: NodeId,
2295}
2296
2297impl GetRelayoutBoundaryParamsBuilder {
2298 pub fn build(self) -> GetRelayoutBoundaryParams {
2299 GetRelayoutBoundaryParams {
2300 node_id: self.node_id,
2301 }
2302 }
2303}
2304
2305#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2308#[serde(rename_all = "camelCase")]
2309pub struct GetRelayoutBoundaryReturns {
2310 #[serde(rename = "nodeId")]
2312 node_id: NodeId,
2313}
2314
2315impl GetRelayoutBoundaryReturns {
2316 pub fn builder(node_id: NodeId) -> GetRelayoutBoundaryReturnsBuilder {
2319 GetRelayoutBoundaryReturnsBuilder {
2320 node_id: node_id,
2321 }
2322 }
2323 pub fn node_id(&self) -> &NodeId { &self.node_id }
2325}
2326
2327
2328pub struct GetRelayoutBoundaryReturnsBuilder {
2329 node_id: NodeId,
2330}
2331
2332impl GetRelayoutBoundaryReturnsBuilder {
2333 pub fn build(self) -> GetRelayoutBoundaryReturns {
2334 GetRelayoutBoundaryReturns {
2335 node_id: self.node_id,
2336 }
2337 }
2338}
2339
2340impl GetRelayoutBoundaryParams { pub const METHOD: &'static str = "DOM.getRelayoutBoundary"; }
2341
2342impl<'a> crate::CdpCommand<'a> for GetRelayoutBoundaryParams {
2343 const METHOD: &'static str = "DOM.getRelayoutBoundary";
2344 type Response = GetRelayoutBoundaryReturns;
2345}
2346
2347#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2351#[serde(rename_all = "camelCase")]
2352pub struct GetSearchResultsParams<'a> {
2353 #[serde(rename = "searchId")]
2355 search_id: Cow<'a, str>,
2356 #[serde(rename = "fromIndex")]
2358 from_index: u64,
2359 #[serde(rename = "toIndex")]
2361 to_index: u64,
2362}
2363
2364impl<'a> GetSearchResultsParams<'a> {
2365 pub fn builder(search_id: impl Into<Cow<'a, str>>, from_index: u64, to_index: u64) -> GetSearchResultsParamsBuilder<'a> {
2370 GetSearchResultsParamsBuilder {
2371 search_id: search_id.into(),
2372 from_index: from_index,
2373 to_index: to_index,
2374 }
2375 }
2376 pub fn search_id(&self) -> &str { self.search_id.as_ref() }
2378 pub fn from_index(&self) -> u64 { self.from_index }
2380 pub fn to_index(&self) -> u64 { self.to_index }
2382}
2383
2384
2385pub struct GetSearchResultsParamsBuilder<'a> {
2386 search_id: Cow<'a, str>,
2387 from_index: u64,
2388 to_index: u64,
2389}
2390
2391impl<'a> GetSearchResultsParamsBuilder<'a> {
2392 pub fn build(self) -> GetSearchResultsParams<'a> {
2393 GetSearchResultsParams {
2394 search_id: self.search_id,
2395 from_index: self.from_index,
2396 to_index: self.to_index,
2397 }
2398 }
2399}
2400
2401#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2405#[serde(rename_all = "camelCase")]
2406pub struct GetSearchResultsReturns {
2407 #[serde(rename = "nodeIds")]
2409 node_ids: Vec<NodeId>,
2410}
2411
2412impl GetSearchResultsReturns {
2413 pub fn builder(node_ids: Vec<NodeId>) -> GetSearchResultsReturnsBuilder {
2416 GetSearchResultsReturnsBuilder {
2417 node_ids: node_ids,
2418 }
2419 }
2420 pub fn node_ids(&self) -> &[NodeId] { &self.node_ids }
2422}
2423
2424
2425pub struct GetSearchResultsReturnsBuilder {
2426 node_ids: Vec<NodeId>,
2427}
2428
2429impl GetSearchResultsReturnsBuilder {
2430 pub fn build(self) -> GetSearchResultsReturns {
2431 GetSearchResultsReturns {
2432 node_ids: self.node_ids,
2433 }
2434 }
2435}
2436
2437impl<'a> GetSearchResultsParams<'a> { pub const METHOD: &'static str = "DOM.getSearchResults"; }
2438
2439impl<'a> crate::CdpCommand<'a> for GetSearchResultsParams<'a> {
2440 const METHOD: &'static str = "DOM.getSearchResults";
2441 type Response = GetSearchResultsReturns;
2442}
2443
2444#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2445pub struct HideHighlightParams {}
2446
2447impl HideHighlightParams { pub const METHOD: &'static str = "DOM.hideHighlight"; }
2448
2449impl<'a> crate::CdpCommand<'a> for HideHighlightParams {
2450 const METHOD: &'static str = "DOM.hideHighlight";
2451 type Response = crate::EmptyReturns;
2452}
2453
2454#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2455pub struct HighlightNodeParams {}
2456
2457impl HighlightNodeParams { pub const METHOD: &'static str = "DOM.highlightNode"; }
2458
2459impl<'a> crate::CdpCommand<'a> for HighlightNodeParams {
2460 const METHOD: &'static str = "DOM.highlightNode";
2461 type Response = crate::EmptyReturns;
2462}
2463
2464#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2465pub struct HighlightRectParams {}
2466
2467impl HighlightRectParams { pub const METHOD: &'static str = "DOM.highlightRect"; }
2468
2469impl<'a> crate::CdpCommand<'a> for HighlightRectParams {
2470 const METHOD: &'static str = "DOM.highlightRect";
2471 type Response = crate::EmptyReturns;
2472}
2473
2474#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2475pub struct MarkUndoableStateParams {}
2476
2477impl MarkUndoableStateParams { pub const METHOD: &'static str = "DOM.markUndoableState"; }
2478
2479impl<'a> crate::CdpCommand<'a> for MarkUndoableStateParams {
2480 const METHOD: &'static str = "DOM.markUndoableState";
2481 type Response = crate::EmptyReturns;
2482}
2483
2484#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2487#[serde(rename_all = "camelCase")]
2488pub struct MoveToParams {
2489 #[serde(rename = "nodeId")]
2491 node_id: NodeId,
2492 #[serde(rename = "targetNodeId")]
2494 target_node_id: NodeId,
2495 #[serde(skip_serializing_if = "Option::is_none", rename = "insertBeforeNodeId")]
2498 insert_before_node_id: Option<NodeId>,
2499}
2500
2501impl MoveToParams {
2502 pub fn builder(node_id: NodeId, target_node_id: NodeId) -> MoveToParamsBuilder {
2506 MoveToParamsBuilder {
2507 node_id: node_id,
2508 target_node_id: target_node_id,
2509 insert_before_node_id: None,
2510 }
2511 }
2512 pub fn node_id(&self) -> &NodeId { &self.node_id }
2514 pub fn target_node_id(&self) -> &NodeId { &self.target_node_id }
2516 pub fn insert_before_node_id(&self) -> Option<&NodeId> { self.insert_before_node_id.as_ref() }
2519}
2520
2521
2522pub struct MoveToParamsBuilder {
2523 node_id: NodeId,
2524 target_node_id: NodeId,
2525 insert_before_node_id: Option<NodeId>,
2526}
2527
2528impl MoveToParamsBuilder {
2529 pub fn insert_before_node_id(mut self, insert_before_node_id: NodeId) -> Self { self.insert_before_node_id = Some(insert_before_node_id); self }
2532 pub fn build(self) -> MoveToParams {
2533 MoveToParams {
2534 node_id: self.node_id,
2535 target_node_id: self.target_node_id,
2536 insert_before_node_id: self.insert_before_node_id,
2537 }
2538 }
2539}
2540
2541#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2544#[serde(rename_all = "camelCase")]
2545pub struct MoveToReturns {
2546 #[serde(rename = "nodeId")]
2548 node_id: NodeId,
2549}
2550
2551impl MoveToReturns {
2552 pub fn builder(node_id: NodeId) -> MoveToReturnsBuilder {
2555 MoveToReturnsBuilder {
2556 node_id: node_id,
2557 }
2558 }
2559 pub fn node_id(&self) -> &NodeId { &self.node_id }
2561}
2562
2563
2564pub struct MoveToReturnsBuilder {
2565 node_id: NodeId,
2566}
2567
2568impl MoveToReturnsBuilder {
2569 pub fn build(self) -> MoveToReturns {
2570 MoveToReturns {
2571 node_id: self.node_id,
2572 }
2573 }
2574}
2575
2576impl MoveToParams { pub const METHOD: &'static str = "DOM.moveTo"; }
2577
2578impl<'a> crate::CdpCommand<'a> for MoveToParams {
2579 const METHOD: &'static str = "DOM.moveTo";
2580 type Response = MoveToReturns;
2581}
2582
2583#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2587#[serde(rename_all = "camelCase")]
2588pub struct PerformSearchParams<'a> {
2589 query: Cow<'a, str>,
2591 #[serde(skip_serializing_if = "Option::is_none", rename = "includeUserAgentShadowDOM")]
2593 include_user_agent_shadow_dom: Option<bool>,
2594}
2595
2596impl<'a> PerformSearchParams<'a> {
2597 pub fn builder(query: impl Into<Cow<'a, str>>) -> PerformSearchParamsBuilder<'a> {
2600 PerformSearchParamsBuilder {
2601 query: query.into(),
2602 include_user_agent_shadow_dom: None,
2603 }
2604 }
2605 pub fn query(&self) -> &str { self.query.as_ref() }
2607 pub fn include_user_agent_shadow_dom(&self) -> Option<bool> { self.include_user_agent_shadow_dom }
2609}
2610
2611
2612pub struct PerformSearchParamsBuilder<'a> {
2613 query: Cow<'a, str>,
2614 include_user_agent_shadow_dom: Option<bool>,
2615}
2616
2617impl<'a> PerformSearchParamsBuilder<'a> {
2618 pub fn include_user_agent_shadow_dom(mut self, include_user_agent_shadow_dom: bool) -> Self { self.include_user_agent_shadow_dom = Some(include_user_agent_shadow_dom); self }
2620 pub fn build(self) -> PerformSearchParams<'a> {
2621 PerformSearchParams {
2622 query: self.query,
2623 include_user_agent_shadow_dom: self.include_user_agent_shadow_dom,
2624 }
2625 }
2626}
2627
2628#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2632#[serde(rename_all = "camelCase")]
2633pub struct PerformSearchReturns<'a> {
2634 #[serde(rename = "searchId")]
2636 search_id: Cow<'a, str>,
2637 #[serde(rename = "resultCount")]
2639 result_count: u64,
2640}
2641
2642impl<'a> PerformSearchReturns<'a> {
2643 pub fn builder(search_id: impl Into<Cow<'a, str>>, result_count: u64) -> PerformSearchReturnsBuilder<'a> {
2647 PerformSearchReturnsBuilder {
2648 search_id: search_id.into(),
2649 result_count: result_count,
2650 }
2651 }
2652 pub fn search_id(&self) -> &str { self.search_id.as_ref() }
2654 pub fn result_count(&self) -> u64 { self.result_count }
2656}
2657
2658
2659pub struct PerformSearchReturnsBuilder<'a> {
2660 search_id: Cow<'a, str>,
2661 result_count: u64,
2662}
2663
2664impl<'a> PerformSearchReturnsBuilder<'a> {
2665 pub fn build(self) -> PerformSearchReturns<'a> {
2666 PerformSearchReturns {
2667 search_id: self.search_id,
2668 result_count: self.result_count,
2669 }
2670 }
2671}
2672
2673impl<'a> PerformSearchParams<'a> { pub const METHOD: &'static str = "DOM.performSearch"; }
2674
2675impl<'a> crate::CdpCommand<'a> for PerformSearchParams<'a> {
2676 const METHOD: &'static str = "DOM.performSearch";
2677 type Response = PerformSearchReturns<'a>;
2678}
2679
2680#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2683#[serde(rename_all = "camelCase")]
2684pub struct PushNodeByPathToFrontendParams<'a> {
2685 path: Cow<'a, str>,
2687}
2688
2689impl<'a> PushNodeByPathToFrontendParams<'a> {
2690 pub fn builder(path: impl Into<Cow<'a, str>>) -> PushNodeByPathToFrontendParamsBuilder<'a> {
2693 PushNodeByPathToFrontendParamsBuilder {
2694 path: path.into(),
2695 }
2696 }
2697 pub fn path(&self) -> &str { self.path.as_ref() }
2699}
2700
2701
2702pub struct PushNodeByPathToFrontendParamsBuilder<'a> {
2703 path: Cow<'a, str>,
2704}
2705
2706impl<'a> PushNodeByPathToFrontendParamsBuilder<'a> {
2707 pub fn build(self) -> PushNodeByPathToFrontendParams<'a> {
2708 PushNodeByPathToFrontendParams {
2709 path: self.path,
2710 }
2711 }
2712}
2713
2714#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2717#[serde(rename_all = "camelCase")]
2718pub struct PushNodeByPathToFrontendReturns {
2719 #[serde(rename = "nodeId")]
2721 node_id: NodeId,
2722}
2723
2724impl PushNodeByPathToFrontendReturns {
2725 pub fn builder(node_id: NodeId) -> PushNodeByPathToFrontendReturnsBuilder {
2728 PushNodeByPathToFrontendReturnsBuilder {
2729 node_id: node_id,
2730 }
2731 }
2732 pub fn node_id(&self) -> &NodeId { &self.node_id }
2734}
2735
2736
2737pub struct PushNodeByPathToFrontendReturnsBuilder {
2738 node_id: NodeId,
2739}
2740
2741impl PushNodeByPathToFrontendReturnsBuilder {
2742 pub fn build(self) -> PushNodeByPathToFrontendReturns {
2743 PushNodeByPathToFrontendReturns {
2744 node_id: self.node_id,
2745 }
2746 }
2747}
2748
2749impl<'a> PushNodeByPathToFrontendParams<'a> { pub const METHOD: &'static str = "DOM.pushNodeByPathToFrontend"; }
2750
2751impl<'a> crate::CdpCommand<'a> for PushNodeByPathToFrontendParams<'a> {
2752 const METHOD: &'static str = "DOM.pushNodeByPathToFrontend";
2753 type Response = PushNodeByPathToFrontendReturns;
2754}
2755
2756#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2759#[serde(rename_all = "camelCase")]
2760pub struct PushNodesByBackendIdsToFrontendParams {
2761 #[serde(rename = "backendNodeIds")]
2763 backend_node_ids: Vec<BackendNodeId>,
2764}
2765
2766impl PushNodesByBackendIdsToFrontendParams {
2767 pub fn builder(backend_node_ids: Vec<BackendNodeId>) -> PushNodesByBackendIdsToFrontendParamsBuilder {
2770 PushNodesByBackendIdsToFrontendParamsBuilder {
2771 backend_node_ids: backend_node_ids,
2772 }
2773 }
2774 pub fn backend_node_ids(&self) -> &[BackendNodeId] { &self.backend_node_ids }
2776}
2777
2778
2779pub struct PushNodesByBackendIdsToFrontendParamsBuilder {
2780 backend_node_ids: Vec<BackendNodeId>,
2781}
2782
2783impl PushNodesByBackendIdsToFrontendParamsBuilder {
2784 pub fn build(self) -> PushNodesByBackendIdsToFrontendParams {
2785 PushNodesByBackendIdsToFrontendParams {
2786 backend_node_ids: self.backend_node_ids,
2787 }
2788 }
2789}
2790
2791#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2794#[serde(rename_all = "camelCase")]
2795pub struct PushNodesByBackendIdsToFrontendReturns {
2796 #[serde(rename = "nodeIds")]
2799 node_ids: Vec<NodeId>,
2800}
2801
2802impl PushNodesByBackendIdsToFrontendReturns {
2803 pub fn builder(node_ids: Vec<NodeId>) -> PushNodesByBackendIdsToFrontendReturnsBuilder {
2806 PushNodesByBackendIdsToFrontendReturnsBuilder {
2807 node_ids: node_ids,
2808 }
2809 }
2810 pub fn node_ids(&self) -> &[NodeId] { &self.node_ids }
2813}
2814
2815
2816pub struct PushNodesByBackendIdsToFrontendReturnsBuilder {
2817 node_ids: Vec<NodeId>,
2818}
2819
2820impl PushNodesByBackendIdsToFrontendReturnsBuilder {
2821 pub fn build(self) -> PushNodesByBackendIdsToFrontendReturns {
2822 PushNodesByBackendIdsToFrontendReturns {
2823 node_ids: self.node_ids,
2824 }
2825 }
2826}
2827
2828impl PushNodesByBackendIdsToFrontendParams { pub const METHOD: &'static str = "DOM.pushNodesByBackendIdsToFrontend"; }
2829
2830impl<'a> crate::CdpCommand<'a> for PushNodesByBackendIdsToFrontendParams {
2831 const METHOD: &'static str = "DOM.pushNodesByBackendIdsToFrontend";
2832 type Response = PushNodesByBackendIdsToFrontendReturns;
2833}
2834
2835#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2838#[serde(rename_all = "camelCase")]
2839pub struct QuerySelectorParams<'a> {
2840 #[serde(rename = "nodeId")]
2842 node_id: NodeId,
2843 selector: Cow<'a, str>,
2845}
2846
2847impl<'a> QuerySelectorParams<'a> {
2848 pub fn builder(node_id: NodeId, selector: impl Into<Cow<'a, str>>) -> QuerySelectorParamsBuilder<'a> {
2852 QuerySelectorParamsBuilder {
2853 node_id: node_id,
2854 selector: selector.into(),
2855 }
2856 }
2857 pub fn node_id(&self) -> &NodeId { &self.node_id }
2859 pub fn selector(&self) -> &str { self.selector.as_ref() }
2861}
2862
2863
2864pub struct QuerySelectorParamsBuilder<'a> {
2865 node_id: NodeId,
2866 selector: Cow<'a, str>,
2867}
2868
2869impl<'a> QuerySelectorParamsBuilder<'a> {
2870 pub fn build(self) -> QuerySelectorParams<'a> {
2871 QuerySelectorParams {
2872 node_id: self.node_id,
2873 selector: self.selector,
2874 }
2875 }
2876}
2877
2878#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2881#[serde(rename_all = "camelCase")]
2882pub struct QuerySelectorReturns {
2883 #[serde(rename = "nodeId")]
2885 node_id: NodeId,
2886}
2887
2888impl QuerySelectorReturns {
2889 pub fn builder(node_id: NodeId) -> QuerySelectorReturnsBuilder {
2892 QuerySelectorReturnsBuilder {
2893 node_id: node_id,
2894 }
2895 }
2896 pub fn node_id(&self) -> &NodeId { &self.node_id }
2898}
2899
2900
2901pub struct QuerySelectorReturnsBuilder {
2902 node_id: NodeId,
2903}
2904
2905impl QuerySelectorReturnsBuilder {
2906 pub fn build(self) -> QuerySelectorReturns {
2907 QuerySelectorReturns {
2908 node_id: self.node_id,
2909 }
2910 }
2911}
2912
2913impl<'a> QuerySelectorParams<'a> { pub const METHOD: &'static str = "DOM.querySelector"; }
2914
2915impl<'a> crate::CdpCommand<'a> for QuerySelectorParams<'a> {
2916 const METHOD: &'static str = "DOM.querySelector";
2917 type Response = QuerySelectorReturns;
2918}
2919
2920#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2923#[serde(rename_all = "camelCase")]
2924pub struct QuerySelectorAllParams<'a> {
2925 #[serde(rename = "nodeId")]
2927 node_id: NodeId,
2928 selector: Cow<'a, str>,
2930}
2931
2932impl<'a> QuerySelectorAllParams<'a> {
2933 pub fn builder(node_id: NodeId, selector: impl Into<Cow<'a, str>>) -> QuerySelectorAllParamsBuilder<'a> {
2937 QuerySelectorAllParamsBuilder {
2938 node_id: node_id,
2939 selector: selector.into(),
2940 }
2941 }
2942 pub fn node_id(&self) -> &NodeId { &self.node_id }
2944 pub fn selector(&self) -> &str { self.selector.as_ref() }
2946}
2947
2948
2949pub struct QuerySelectorAllParamsBuilder<'a> {
2950 node_id: NodeId,
2951 selector: Cow<'a, str>,
2952}
2953
2954impl<'a> QuerySelectorAllParamsBuilder<'a> {
2955 pub fn build(self) -> QuerySelectorAllParams<'a> {
2956 QuerySelectorAllParams {
2957 node_id: self.node_id,
2958 selector: self.selector,
2959 }
2960 }
2961}
2962
2963#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2966#[serde(rename_all = "camelCase")]
2967pub struct QuerySelectorAllReturns {
2968 #[serde(rename = "nodeIds")]
2970 node_ids: Vec<NodeId>,
2971}
2972
2973impl QuerySelectorAllReturns {
2974 pub fn builder(node_ids: Vec<NodeId>) -> QuerySelectorAllReturnsBuilder {
2977 QuerySelectorAllReturnsBuilder {
2978 node_ids: node_ids,
2979 }
2980 }
2981 pub fn node_ids(&self) -> &[NodeId] { &self.node_ids }
2983}
2984
2985
2986pub struct QuerySelectorAllReturnsBuilder {
2987 node_ids: Vec<NodeId>,
2988}
2989
2990impl QuerySelectorAllReturnsBuilder {
2991 pub fn build(self) -> QuerySelectorAllReturns {
2992 QuerySelectorAllReturns {
2993 node_ids: self.node_ids,
2994 }
2995 }
2996}
2997
2998impl<'a> QuerySelectorAllParams<'a> { pub const METHOD: &'static str = "DOM.querySelectorAll"; }
2999
3000impl<'a> crate::CdpCommand<'a> for QuerySelectorAllParams<'a> {
3001 const METHOD: &'static str = "DOM.querySelectorAll";
3002 type Response = QuerySelectorAllReturns;
3003}
3004
3005#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3010#[serde(rename_all = "camelCase")]
3011pub struct GetTopLayerElementsReturns {
3012 #[serde(rename = "nodeIds")]
3014 node_ids: Vec<NodeId>,
3015}
3016
3017impl GetTopLayerElementsReturns {
3018 pub fn builder(node_ids: Vec<NodeId>) -> GetTopLayerElementsReturnsBuilder {
3021 GetTopLayerElementsReturnsBuilder {
3022 node_ids: node_ids,
3023 }
3024 }
3025 pub fn node_ids(&self) -> &[NodeId] { &self.node_ids }
3027}
3028
3029
3030pub struct GetTopLayerElementsReturnsBuilder {
3031 node_ids: Vec<NodeId>,
3032}
3033
3034impl GetTopLayerElementsReturnsBuilder {
3035 pub fn build(self) -> GetTopLayerElementsReturns {
3036 GetTopLayerElementsReturns {
3037 node_ids: self.node_ids,
3038 }
3039 }
3040}
3041
3042#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3043pub struct GetTopLayerElementsParams {}
3044
3045impl GetTopLayerElementsParams { pub const METHOD: &'static str = "DOM.getTopLayerElements"; }
3046
3047impl<'a> crate::CdpCommand<'a> for GetTopLayerElementsParams {
3048 const METHOD: &'static str = "DOM.getTopLayerElements";
3049 type Response = GetTopLayerElementsReturns;
3050}
3051
3052#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3055#[serde(rename_all = "camelCase")]
3056pub struct GetElementByRelationParams<'a> {
3057 #[serde(rename = "nodeId")]
3059 node_id: NodeId,
3060 relation: Cow<'a, str>,
3062}
3063
3064impl<'a> GetElementByRelationParams<'a> {
3065 pub fn builder(node_id: NodeId, relation: impl Into<Cow<'a, str>>) -> GetElementByRelationParamsBuilder<'a> {
3069 GetElementByRelationParamsBuilder {
3070 node_id: node_id,
3071 relation: relation.into(),
3072 }
3073 }
3074 pub fn node_id(&self) -> &NodeId { &self.node_id }
3076 pub fn relation(&self) -> &str { self.relation.as_ref() }
3078}
3079
3080
3081pub struct GetElementByRelationParamsBuilder<'a> {
3082 node_id: NodeId,
3083 relation: Cow<'a, str>,
3084}
3085
3086impl<'a> GetElementByRelationParamsBuilder<'a> {
3087 pub fn build(self) -> GetElementByRelationParams<'a> {
3088 GetElementByRelationParams {
3089 node_id: self.node_id,
3090 relation: self.relation,
3091 }
3092 }
3093}
3094
3095#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3098#[serde(rename_all = "camelCase")]
3099pub struct GetElementByRelationReturns {
3100 #[serde(rename = "nodeId")]
3102 node_id: NodeId,
3103}
3104
3105impl GetElementByRelationReturns {
3106 pub fn builder(node_id: NodeId) -> GetElementByRelationReturnsBuilder {
3109 GetElementByRelationReturnsBuilder {
3110 node_id: node_id,
3111 }
3112 }
3113 pub fn node_id(&self) -> &NodeId { &self.node_id }
3115}
3116
3117
3118pub struct GetElementByRelationReturnsBuilder {
3119 node_id: NodeId,
3120}
3121
3122impl GetElementByRelationReturnsBuilder {
3123 pub fn build(self) -> GetElementByRelationReturns {
3124 GetElementByRelationReturns {
3125 node_id: self.node_id,
3126 }
3127 }
3128}
3129
3130impl<'a> GetElementByRelationParams<'a> { pub const METHOD: &'static str = "DOM.getElementByRelation"; }
3131
3132impl<'a> crate::CdpCommand<'a> for GetElementByRelationParams<'a> {
3133 const METHOD: &'static str = "DOM.getElementByRelation";
3134 type Response = GetElementByRelationReturns;
3135}
3136
3137#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3138pub struct RedoParams {}
3139
3140impl RedoParams { pub const METHOD: &'static str = "DOM.redo"; }
3141
3142impl<'a> crate::CdpCommand<'a> for RedoParams {
3143 const METHOD: &'static str = "DOM.redo";
3144 type Response = crate::EmptyReturns;
3145}
3146
3147#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3150#[serde(rename_all = "camelCase")]
3151pub struct RemoveAttributeParams<'a> {
3152 #[serde(rename = "nodeId")]
3154 node_id: NodeId,
3155 name: Cow<'a, str>,
3157}
3158
3159impl<'a> RemoveAttributeParams<'a> {
3160 pub fn builder(node_id: NodeId, name: impl Into<Cow<'a, str>>) -> RemoveAttributeParamsBuilder<'a> {
3164 RemoveAttributeParamsBuilder {
3165 node_id: node_id,
3166 name: name.into(),
3167 }
3168 }
3169 pub fn node_id(&self) -> &NodeId { &self.node_id }
3171 pub fn name(&self) -> &str { self.name.as_ref() }
3173}
3174
3175
3176pub struct RemoveAttributeParamsBuilder<'a> {
3177 node_id: NodeId,
3178 name: Cow<'a, str>,
3179}
3180
3181impl<'a> RemoveAttributeParamsBuilder<'a> {
3182 pub fn build(self) -> RemoveAttributeParams<'a> {
3183 RemoveAttributeParams {
3184 node_id: self.node_id,
3185 name: self.name,
3186 }
3187 }
3188}
3189
3190impl<'a> RemoveAttributeParams<'a> { pub const METHOD: &'static str = "DOM.removeAttribute"; }
3191
3192impl<'a> crate::CdpCommand<'a> for RemoveAttributeParams<'a> {
3193 const METHOD: &'static str = "DOM.removeAttribute";
3194 type Response = crate::EmptyReturns;
3195}
3196
3197#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3200#[serde(rename_all = "camelCase")]
3201pub struct RemoveNodeParams {
3202 #[serde(rename = "nodeId")]
3204 node_id: NodeId,
3205}
3206
3207impl RemoveNodeParams {
3208 pub fn builder(node_id: NodeId) -> RemoveNodeParamsBuilder {
3211 RemoveNodeParamsBuilder {
3212 node_id: node_id,
3213 }
3214 }
3215 pub fn node_id(&self) -> &NodeId { &self.node_id }
3217}
3218
3219
3220pub struct RemoveNodeParamsBuilder {
3221 node_id: NodeId,
3222}
3223
3224impl RemoveNodeParamsBuilder {
3225 pub fn build(self) -> RemoveNodeParams {
3226 RemoveNodeParams {
3227 node_id: self.node_id,
3228 }
3229 }
3230}
3231
3232impl RemoveNodeParams { pub const METHOD: &'static str = "DOM.removeNode"; }
3233
3234impl<'a> crate::CdpCommand<'a> for RemoveNodeParams {
3235 const METHOD: &'static str = "DOM.removeNode";
3236 type Response = crate::EmptyReturns;
3237}
3238
3239#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3244#[serde(rename_all = "camelCase")]
3245pub struct RequestChildNodesParams {
3246 #[serde(rename = "nodeId")]
3248 node_id: NodeId,
3249 #[serde(skip_serializing_if = "Option::is_none")]
3252 depth: Option<i64>,
3253 #[serde(skip_serializing_if = "Option::is_none")]
3256 pierce: Option<bool>,
3257}
3258
3259impl RequestChildNodesParams {
3260 pub fn builder(node_id: NodeId) -> RequestChildNodesParamsBuilder {
3263 RequestChildNodesParamsBuilder {
3264 node_id: node_id,
3265 depth: None,
3266 pierce: None,
3267 }
3268 }
3269 pub fn node_id(&self) -> &NodeId { &self.node_id }
3271 pub fn depth(&self) -> Option<i64> { self.depth }
3274 pub fn pierce(&self) -> Option<bool> { self.pierce }
3277}
3278
3279
3280pub struct RequestChildNodesParamsBuilder {
3281 node_id: NodeId,
3282 depth: Option<i64>,
3283 pierce: Option<bool>,
3284}
3285
3286impl RequestChildNodesParamsBuilder {
3287 pub fn depth(mut self, depth: i64) -> Self { self.depth = Some(depth); self }
3290 pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
3293 pub fn build(self) -> RequestChildNodesParams {
3294 RequestChildNodesParams {
3295 node_id: self.node_id,
3296 depth: self.depth,
3297 pierce: self.pierce,
3298 }
3299 }
3300}
3301
3302impl RequestChildNodesParams { pub const METHOD: &'static str = "DOM.requestChildNodes"; }
3303
3304impl<'a> crate::CdpCommand<'a> for RequestChildNodesParams {
3305 const METHOD: &'static str = "DOM.requestChildNodes";
3306 type Response = crate::EmptyReturns;
3307}
3308
3309#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3314#[serde(rename_all = "camelCase")]
3315pub struct RequestNodeParams<'a> {
3316 #[serde(rename = "objectId")]
3318 object_id: crate::runtime::RemoteObjectId<'a>,
3319}
3320
3321impl<'a> RequestNodeParams<'a> {
3322 pub fn builder(object_id: crate::runtime::RemoteObjectId<'a>) -> RequestNodeParamsBuilder<'a> {
3325 RequestNodeParamsBuilder {
3326 object_id: object_id,
3327 }
3328 }
3329 pub fn object_id(&self) -> &crate::runtime::RemoteObjectId<'a> { &self.object_id }
3331}
3332
3333
3334pub struct RequestNodeParamsBuilder<'a> {
3335 object_id: crate::runtime::RemoteObjectId<'a>,
3336}
3337
3338impl<'a> RequestNodeParamsBuilder<'a> {
3339 pub fn build(self) -> RequestNodeParams<'a> {
3340 RequestNodeParams {
3341 object_id: self.object_id,
3342 }
3343 }
3344}
3345
3346#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3351#[serde(rename_all = "camelCase")]
3352pub struct RequestNodeReturns {
3353 #[serde(rename = "nodeId")]
3355 node_id: NodeId,
3356}
3357
3358impl RequestNodeReturns {
3359 pub fn builder(node_id: NodeId) -> RequestNodeReturnsBuilder {
3362 RequestNodeReturnsBuilder {
3363 node_id: node_id,
3364 }
3365 }
3366 pub fn node_id(&self) -> &NodeId { &self.node_id }
3368}
3369
3370
3371pub struct RequestNodeReturnsBuilder {
3372 node_id: NodeId,
3373}
3374
3375impl RequestNodeReturnsBuilder {
3376 pub fn build(self) -> RequestNodeReturns {
3377 RequestNodeReturns {
3378 node_id: self.node_id,
3379 }
3380 }
3381}
3382
3383impl<'a> RequestNodeParams<'a> { pub const METHOD: &'static str = "DOM.requestNode"; }
3384
3385impl<'a> crate::CdpCommand<'a> for RequestNodeParams<'a> {
3386 const METHOD: &'static str = "DOM.requestNode";
3387 type Response = RequestNodeReturns;
3388}
3389
3390#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3393#[serde(rename_all = "camelCase")]
3394pub struct ResolveNodeParams<'a> {
3395 #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
3397 node_id: Option<NodeId>,
3398 #[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
3400 backend_node_id: Option<crate::dom::BackendNodeId>,
3401 #[serde(skip_serializing_if = "Option::is_none", rename = "objectGroup")]
3403 object_group: Option<Cow<'a, str>>,
3404 #[serde(skip_serializing_if = "Option::is_none", rename = "executionContextId")]
3406 execution_context_id: Option<crate::runtime::ExecutionContextId>,
3407}
3408
3409impl<'a> ResolveNodeParams<'a> {
3410 pub fn builder() -> ResolveNodeParamsBuilder<'a> {
3412 ResolveNodeParamsBuilder {
3413 node_id: None,
3414 backend_node_id: None,
3415 object_group: None,
3416 execution_context_id: None,
3417 }
3418 }
3419 pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
3421 pub fn backend_node_id(&self) -> Option<&crate::dom::BackendNodeId> { self.backend_node_id.as_ref() }
3423 pub fn object_group(&self) -> Option<&str> { self.object_group.as_deref() }
3425 pub fn execution_context_id(&self) -> Option<&crate::runtime::ExecutionContextId> { self.execution_context_id.as_ref() }
3427}
3428
3429#[derive(Default)]
3430pub struct ResolveNodeParamsBuilder<'a> {
3431 node_id: Option<NodeId>,
3432 backend_node_id: Option<crate::dom::BackendNodeId>,
3433 object_group: Option<Cow<'a, str>>,
3434 execution_context_id: Option<crate::runtime::ExecutionContextId>,
3435}
3436
3437impl<'a> ResolveNodeParamsBuilder<'a> {
3438 pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
3440 pub fn backend_node_id(mut self, backend_node_id: crate::dom::BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
3442 pub fn object_group(mut self, object_group: impl Into<Cow<'a, str>>) -> Self { self.object_group = Some(object_group.into()); self }
3444 pub fn execution_context_id(mut self, execution_context_id: crate::runtime::ExecutionContextId) -> Self { self.execution_context_id = Some(execution_context_id); self }
3446 pub fn build(self) -> ResolveNodeParams<'a> {
3447 ResolveNodeParams {
3448 node_id: self.node_id,
3449 backend_node_id: self.backend_node_id,
3450 object_group: self.object_group,
3451 execution_context_id: self.execution_context_id,
3452 }
3453 }
3454}
3455
3456#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3459#[serde(rename_all = "camelCase")]
3460pub struct ResolveNodeReturns {
3461 object: crate::runtime::RemoteObject,
3463}
3464
3465impl ResolveNodeReturns {
3466 pub fn builder(object: crate::runtime::RemoteObject) -> ResolveNodeReturnsBuilder {
3469 ResolveNodeReturnsBuilder {
3470 object: object,
3471 }
3472 }
3473 pub fn object(&self) -> &crate::runtime::RemoteObject { &self.object }
3475}
3476
3477
3478pub struct ResolveNodeReturnsBuilder {
3479 object: crate::runtime::RemoteObject,
3480}
3481
3482impl ResolveNodeReturnsBuilder {
3483 pub fn build(self) -> ResolveNodeReturns {
3484 ResolveNodeReturns {
3485 object: self.object,
3486 }
3487 }
3488}
3489
3490impl<'a> ResolveNodeParams<'a> { pub const METHOD: &'static str = "DOM.resolveNode"; }
3491
3492impl<'a> crate::CdpCommand<'a> for ResolveNodeParams<'a> {
3493 const METHOD: &'static str = "DOM.resolveNode";
3494 type Response = ResolveNodeReturns;
3495}
3496
3497#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3500#[serde(rename_all = "camelCase")]
3501pub struct SetAttributeValueParams<'a> {
3502 #[serde(rename = "nodeId")]
3504 node_id: NodeId,
3505 name: Cow<'a, str>,
3507 value: Cow<'a, str>,
3509}
3510
3511impl<'a> SetAttributeValueParams<'a> {
3512 pub fn builder(node_id: NodeId, name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> SetAttributeValueParamsBuilder<'a> {
3517 SetAttributeValueParamsBuilder {
3518 node_id: node_id,
3519 name: name.into(),
3520 value: value.into(),
3521 }
3522 }
3523 pub fn node_id(&self) -> &NodeId { &self.node_id }
3525 pub fn name(&self) -> &str { self.name.as_ref() }
3527 pub fn value(&self) -> &str { self.value.as_ref() }
3529}
3530
3531
3532pub struct SetAttributeValueParamsBuilder<'a> {
3533 node_id: NodeId,
3534 name: Cow<'a, str>,
3535 value: Cow<'a, str>,
3536}
3537
3538impl<'a> SetAttributeValueParamsBuilder<'a> {
3539 pub fn build(self) -> SetAttributeValueParams<'a> {
3540 SetAttributeValueParams {
3541 node_id: self.node_id,
3542 name: self.name,
3543 value: self.value,
3544 }
3545 }
3546}
3547
3548impl<'a> SetAttributeValueParams<'a> { pub const METHOD: &'static str = "DOM.setAttributeValue"; }
3549
3550impl<'a> crate::CdpCommand<'a> for SetAttributeValueParams<'a> {
3551 const METHOD: &'static str = "DOM.setAttributeValue";
3552 type Response = crate::EmptyReturns;
3553}
3554
3555#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3559#[serde(rename_all = "camelCase")]
3560pub struct SetAttributesAsTextParams<'a> {
3561 #[serde(rename = "nodeId")]
3563 node_id: NodeId,
3564 text: Cow<'a, str>,
3566 #[serde(skip_serializing_if = "Option::is_none")]
3569 name: Option<Cow<'a, str>>,
3570}
3571
3572impl<'a> SetAttributesAsTextParams<'a> {
3573 pub fn builder(node_id: NodeId, text: impl Into<Cow<'a, str>>) -> SetAttributesAsTextParamsBuilder<'a> {
3577 SetAttributesAsTextParamsBuilder {
3578 node_id: node_id,
3579 text: text.into(),
3580 name: None,
3581 }
3582 }
3583 pub fn node_id(&self) -> &NodeId { &self.node_id }
3585 pub fn text(&self) -> &str { self.text.as_ref() }
3587 pub fn name(&self) -> Option<&str> { self.name.as_deref() }
3590}
3591
3592
3593pub struct SetAttributesAsTextParamsBuilder<'a> {
3594 node_id: NodeId,
3595 text: Cow<'a, str>,
3596 name: Option<Cow<'a, str>>,
3597}
3598
3599impl<'a> SetAttributesAsTextParamsBuilder<'a> {
3600 pub fn name(mut self, name: impl Into<Cow<'a, str>>) -> Self { self.name = Some(name.into()); self }
3603 pub fn build(self) -> SetAttributesAsTextParams<'a> {
3604 SetAttributesAsTextParams {
3605 node_id: self.node_id,
3606 text: self.text,
3607 name: self.name,
3608 }
3609 }
3610}
3611
3612impl<'a> SetAttributesAsTextParams<'a> { pub const METHOD: &'static str = "DOM.setAttributesAsText"; }
3613
3614impl<'a> crate::CdpCommand<'a> for SetAttributesAsTextParams<'a> {
3615 const METHOD: &'static str = "DOM.setAttributesAsText";
3616 type Response = crate::EmptyReturns;
3617}
3618
3619#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3622#[serde(rename_all = "camelCase")]
3623pub struct SetFileInputFilesParams<'a> {
3624 files: Vec<Cow<'a, str>>,
3626 #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
3628 node_id: Option<NodeId>,
3629 #[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
3631 backend_node_id: Option<BackendNodeId>,
3632 #[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
3634 object_id: Option<crate::runtime::RemoteObjectId<'a>>,
3635}
3636
3637impl<'a> SetFileInputFilesParams<'a> {
3638 pub fn builder(files: Vec<Cow<'a, str>>) -> SetFileInputFilesParamsBuilder<'a> {
3641 SetFileInputFilesParamsBuilder {
3642 files: files,
3643 node_id: None,
3644 backend_node_id: None,
3645 object_id: None,
3646 }
3647 }
3648 pub fn files(&self) -> &[Cow<'a, str>] { &self.files }
3650 pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
3652 pub fn backend_node_id(&self) -> Option<&BackendNodeId> { self.backend_node_id.as_ref() }
3654 pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
3656}
3657
3658
3659pub struct SetFileInputFilesParamsBuilder<'a> {
3660 files: Vec<Cow<'a, str>>,
3661 node_id: Option<NodeId>,
3662 backend_node_id: Option<BackendNodeId>,
3663 object_id: Option<crate::runtime::RemoteObjectId<'a>>,
3664}
3665
3666impl<'a> SetFileInputFilesParamsBuilder<'a> {
3667 pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
3669 pub fn backend_node_id(mut self, backend_node_id: BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
3671 pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
3673 pub fn build(self) -> SetFileInputFilesParams<'a> {
3674 SetFileInputFilesParams {
3675 files: self.files,
3676 node_id: self.node_id,
3677 backend_node_id: self.backend_node_id,
3678 object_id: self.object_id,
3679 }
3680 }
3681}
3682
3683impl<'a> SetFileInputFilesParams<'a> { pub const METHOD: &'static str = "DOM.setFileInputFiles"; }
3684
3685impl<'a> crate::CdpCommand<'a> for SetFileInputFilesParams<'a> {
3686 const METHOD: &'static str = "DOM.setFileInputFiles";
3687 type Response = crate::EmptyReturns;
3688}
3689
3690#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3693#[serde(rename_all = "camelCase")]
3694pub struct SetNodeStackTracesEnabledParams {
3695 enable: bool,
3697}
3698
3699impl SetNodeStackTracesEnabledParams {
3700 pub fn builder(enable: bool) -> SetNodeStackTracesEnabledParamsBuilder {
3703 SetNodeStackTracesEnabledParamsBuilder {
3704 enable: enable,
3705 }
3706 }
3707 pub fn enable(&self) -> bool { self.enable }
3709}
3710
3711
3712pub struct SetNodeStackTracesEnabledParamsBuilder {
3713 enable: bool,
3714}
3715
3716impl SetNodeStackTracesEnabledParamsBuilder {
3717 pub fn build(self) -> SetNodeStackTracesEnabledParams {
3718 SetNodeStackTracesEnabledParams {
3719 enable: self.enable,
3720 }
3721 }
3722}
3723
3724impl SetNodeStackTracesEnabledParams { pub const METHOD: &'static str = "DOM.setNodeStackTracesEnabled"; }
3725
3726impl<'a> crate::CdpCommand<'a> for SetNodeStackTracesEnabledParams {
3727 const METHOD: &'static str = "DOM.setNodeStackTracesEnabled";
3728 type Response = crate::EmptyReturns;
3729}
3730
3731#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3734#[serde(rename_all = "camelCase")]
3735pub struct GetNodeStackTracesParams {
3736 #[serde(rename = "nodeId")]
3738 node_id: NodeId,
3739}
3740
3741impl GetNodeStackTracesParams {
3742 pub fn builder(node_id: NodeId) -> GetNodeStackTracesParamsBuilder {
3745 GetNodeStackTracesParamsBuilder {
3746 node_id: node_id,
3747 }
3748 }
3749 pub fn node_id(&self) -> &NodeId { &self.node_id }
3751}
3752
3753
3754pub struct GetNodeStackTracesParamsBuilder {
3755 node_id: NodeId,
3756}
3757
3758impl GetNodeStackTracesParamsBuilder {
3759 pub fn build(self) -> GetNodeStackTracesParams {
3760 GetNodeStackTracesParams {
3761 node_id: self.node_id,
3762 }
3763 }
3764}
3765
3766#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3769#[serde(rename_all = "camelCase")]
3770pub struct GetNodeStackTracesReturns {
3771 #[serde(skip_serializing_if = "Option::is_none")]
3773 creation: Option<crate::runtime::StackTrace>,
3774}
3775
3776impl GetNodeStackTracesReturns {
3777 pub fn builder() -> GetNodeStackTracesReturnsBuilder {
3779 GetNodeStackTracesReturnsBuilder {
3780 creation: None,
3781 }
3782 }
3783 pub fn creation(&self) -> Option<&crate::runtime::StackTrace> { self.creation.as_ref() }
3785}
3786
3787#[derive(Default)]
3788pub struct GetNodeStackTracesReturnsBuilder {
3789 creation: Option<crate::runtime::StackTrace>,
3790}
3791
3792impl GetNodeStackTracesReturnsBuilder {
3793 pub fn creation(mut self, creation: crate::runtime::StackTrace) -> Self { self.creation = Some(creation); self }
3795 pub fn build(self) -> GetNodeStackTracesReturns {
3796 GetNodeStackTracesReturns {
3797 creation: self.creation,
3798 }
3799 }
3800}
3801
3802impl GetNodeStackTracesParams { pub const METHOD: &'static str = "DOM.getNodeStackTraces"; }
3803
3804impl<'a> crate::CdpCommand<'a> for GetNodeStackTracesParams {
3805 const METHOD: &'static str = "DOM.getNodeStackTraces";
3806 type Response = GetNodeStackTracesReturns;
3807}
3808
3809#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3813#[serde(rename_all = "camelCase")]
3814pub struct GetFileInfoParams<'a> {
3815 #[serde(rename = "objectId")]
3817 object_id: crate::runtime::RemoteObjectId<'a>,
3818}
3819
3820impl<'a> GetFileInfoParams<'a> {
3821 pub fn builder(object_id: crate::runtime::RemoteObjectId<'a>) -> GetFileInfoParamsBuilder<'a> {
3824 GetFileInfoParamsBuilder {
3825 object_id: object_id,
3826 }
3827 }
3828 pub fn object_id(&self) -> &crate::runtime::RemoteObjectId<'a> { &self.object_id }
3830}
3831
3832
3833pub struct GetFileInfoParamsBuilder<'a> {
3834 object_id: crate::runtime::RemoteObjectId<'a>,
3835}
3836
3837impl<'a> GetFileInfoParamsBuilder<'a> {
3838 pub fn build(self) -> GetFileInfoParams<'a> {
3839 GetFileInfoParams {
3840 object_id: self.object_id,
3841 }
3842 }
3843}
3844
3845#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3849#[serde(rename_all = "camelCase")]
3850pub struct GetFileInfoReturns<'a> {
3851 path: Cow<'a, str>,
3852}
3853
3854impl<'a> GetFileInfoReturns<'a> {
3855 pub fn builder(path: impl Into<Cow<'a, str>>) -> GetFileInfoReturnsBuilder<'a> {
3858 GetFileInfoReturnsBuilder {
3859 path: path.into(),
3860 }
3861 }
3862 pub fn path(&self) -> &str { self.path.as_ref() }
3863}
3864
3865
3866pub struct GetFileInfoReturnsBuilder<'a> {
3867 path: Cow<'a, str>,
3868}
3869
3870impl<'a> GetFileInfoReturnsBuilder<'a> {
3871 pub fn build(self) -> GetFileInfoReturns<'a> {
3872 GetFileInfoReturns {
3873 path: self.path,
3874 }
3875 }
3876}
3877
3878impl<'a> GetFileInfoParams<'a> { pub const METHOD: &'static str = "DOM.getFileInfo"; }
3879
3880impl<'a> crate::CdpCommand<'a> for GetFileInfoParams<'a> {
3881 const METHOD: &'static str = "DOM.getFileInfo";
3882 type Response = GetFileInfoReturns<'a>;
3883}
3884
3885#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3888#[serde(rename_all = "camelCase")]
3889pub struct GetDetachedDomNodesReturns<'a> {
3890 #[serde(rename = "detachedNodes")]
3892 detached_nodes: Vec<DetachedElementInfo<'a>>,
3893}
3894
3895impl<'a> GetDetachedDomNodesReturns<'a> {
3896 pub fn builder(detached_nodes: Vec<DetachedElementInfo<'a>>) -> GetDetachedDomNodesReturnsBuilder<'a> {
3899 GetDetachedDomNodesReturnsBuilder {
3900 detached_nodes: detached_nodes,
3901 }
3902 }
3903 pub fn detached_nodes(&self) -> &[DetachedElementInfo<'a>] { &self.detached_nodes }
3905}
3906
3907
3908pub struct GetDetachedDomNodesReturnsBuilder<'a> {
3909 detached_nodes: Vec<DetachedElementInfo<'a>>,
3910}
3911
3912impl<'a> GetDetachedDomNodesReturnsBuilder<'a> {
3913 pub fn build(self) -> GetDetachedDomNodesReturns<'a> {
3914 GetDetachedDomNodesReturns {
3915 detached_nodes: self.detached_nodes,
3916 }
3917 }
3918}
3919
3920#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3921pub struct GetDetachedDomNodesParams {}
3922
3923impl GetDetachedDomNodesParams { pub const METHOD: &'static str = "DOM.getDetachedDomNodes"; }
3924
3925impl<'a> crate::CdpCommand<'a> for GetDetachedDomNodesParams {
3926 const METHOD: &'static str = "DOM.getDetachedDomNodes";
3927 type Response = GetDetachedDomNodesReturns<'a>;
3928}
3929
3930#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3934#[serde(rename_all = "camelCase")]
3935pub struct SetInspectedNodeParams {
3936 #[serde(rename = "nodeId")]
3938 node_id: NodeId,
3939}
3940
3941impl SetInspectedNodeParams {
3942 pub fn builder(node_id: NodeId) -> SetInspectedNodeParamsBuilder {
3945 SetInspectedNodeParamsBuilder {
3946 node_id: node_id,
3947 }
3948 }
3949 pub fn node_id(&self) -> &NodeId { &self.node_id }
3951}
3952
3953
3954pub struct SetInspectedNodeParamsBuilder {
3955 node_id: NodeId,
3956}
3957
3958impl SetInspectedNodeParamsBuilder {
3959 pub fn build(self) -> SetInspectedNodeParams {
3960 SetInspectedNodeParams {
3961 node_id: self.node_id,
3962 }
3963 }
3964}
3965
3966impl SetInspectedNodeParams { pub const METHOD: &'static str = "DOM.setInspectedNode"; }
3967
3968impl<'a> crate::CdpCommand<'a> for SetInspectedNodeParams {
3969 const METHOD: &'static str = "DOM.setInspectedNode";
3970 type Response = crate::EmptyReturns;
3971}
3972
3973#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3976#[serde(rename_all = "camelCase")]
3977pub struct SetNodeNameParams<'a> {
3978 #[serde(rename = "nodeId")]
3980 node_id: NodeId,
3981 name: Cow<'a, str>,
3983}
3984
3985impl<'a> SetNodeNameParams<'a> {
3986 pub fn builder(node_id: NodeId, name: impl Into<Cow<'a, str>>) -> SetNodeNameParamsBuilder<'a> {
3990 SetNodeNameParamsBuilder {
3991 node_id: node_id,
3992 name: name.into(),
3993 }
3994 }
3995 pub fn node_id(&self) -> &NodeId { &self.node_id }
3997 pub fn name(&self) -> &str { self.name.as_ref() }
3999}
4000
4001
4002pub struct SetNodeNameParamsBuilder<'a> {
4003 node_id: NodeId,
4004 name: Cow<'a, str>,
4005}
4006
4007impl<'a> SetNodeNameParamsBuilder<'a> {
4008 pub fn build(self) -> SetNodeNameParams<'a> {
4009 SetNodeNameParams {
4010 node_id: self.node_id,
4011 name: self.name,
4012 }
4013 }
4014}
4015
4016#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4019#[serde(rename_all = "camelCase")]
4020pub struct SetNodeNameReturns {
4021 #[serde(rename = "nodeId")]
4023 node_id: NodeId,
4024}
4025
4026impl SetNodeNameReturns {
4027 pub fn builder(node_id: NodeId) -> SetNodeNameReturnsBuilder {
4030 SetNodeNameReturnsBuilder {
4031 node_id: node_id,
4032 }
4033 }
4034 pub fn node_id(&self) -> &NodeId { &self.node_id }
4036}
4037
4038
4039pub struct SetNodeNameReturnsBuilder {
4040 node_id: NodeId,
4041}
4042
4043impl SetNodeNameReturnsBuilder {
4044 pub fn build(self) -> SetNodeNameReturns {
4045 SetNodeNameReturns {
4046 node_id: self.node_id,
4047 }
4048 }
4049}
4050
4051impl<'a> SetNodeNameParams<'a> { pub const METHOD: &'static str = "DOM.setNodeName"; }
4052
4053impl<'a> crate::CdpCommand<'a> for SetNodeNameParams<'a> {
4054 const METHOD: &'static str = "DOM.setNodeName";
4055 type Response = SetNodeNameReturns;
4056}
4057
4058#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4061#[serde(rename_all = "camelCase")]
4062pub struct SetNodeValueParams<'a> {
4063 #[serde(rename = "nodeId")]
4065 node_id: NodeId,
4066 value: Cow<'a, str>,
4068}
4069
4070impl<'a> SetNodeValueParams<'a> {
4071 pub fn builder(node_id: NodeId, value: impl Into<Cow<'a, str>>) -> SetNodeValueParamsBuilder<'a> {
4075 SetNodeValueParamsBuilder {
4076 node_id: node_id,
4077 value: value.into(),
4078 }
4079 }
4080 pub fn node_id(&self) -> &NodeId { &self.node_id }
4082 pub fn value(&self) -> &str { self.value.as_ref() }
4084}
4085
4086
4087pub struct SetNodeValueParamsBuilder<'a> {
4088 node_id: NodeId,
4089 value: Cow<'a, str>,
4090}
4091
4092impl<'a> SetNodeValueParamsBuilder<'a> {
4093 pub fn build(self) -> SetNodeValueParams<'a> {
4094 SetNodeValueParams {
4095 node_id: self.node_id,
4096 value: self.value,
4097 }
4098 }
4099}
4100
4101impl<'a> SetNodeValueParams<'a> { pub const METHOD: &'static str = "DOM.setNodeValue"; }
4102
4103impl<'a> crate::CdpCommand<'a> for SetNodeValueParams<'a> {
4104 const METHOD: &'static str = "DOM.setNodeValue";
4105 type Response = crate::EmptyReturns;
4106}
4107
4108#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4111#[serde(rename_all = "camelCase")]
4112pub struct SetOuterHTMLParams<'a> {
4113 #[serde(rename = "nodeId")]
4115 node_id: NodeId,
4116 #[serde(rename = "outerHTML")]
4118 outer_html: Cow<'a, str>,
4119}
4120
4121impl<'a> SetOuterHTMLParams<'a> {
4122 pub fn builder(node_id: NodeId, outer_html: impl Into<Cow<'a, str>>) -> SetOuterHTMLParamsBuilder<'a> {
4126 SetOuterHTMLParamsBuilder {
4127 node_id: node_id,
4128 outer_html: outer_html.into(),
4129 }
4130 }
4131 pub fn node_id(&self) -> &NodeId { &self.node_id }
4133 pub fn outer_html(&self) -> &str { self.outer_html.as_ref() }
4135}
4136
4137
4138pub struct SetOuterHTMLParamsBuilder<'a> {
4139 node_id: NodeId,
4140 outer_html: Cow<'a, str>,
4141}
4142
4143impl<'a> SetOuterHTMLParamsBuilder<'a> {
4144 pub fn build(self) -> SetOuterHTMLParams<'a> {
4145 SetOuterHTMLParams {
4146 node_id: self.node_id,
4147 outer_html: self.outer_html,
4148 }
4149 }
4150}
4151
4152impl<'a> SetOuterHTMLParams<'a> { pub const METHOD: &'static str = "DOM.setOuterHTML"; }
4153
4154impl<'a> crate::CdpCommand<'a> for SetOuterHTMLParams<'a> {
4155 const METHOD: &'static str = "DOM.setOuterHTML";
4156 type Response = crate::EmptyReturns;
4157}
4158
4159#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4160pub struct UndoParams {}
4161
4162impl UndoParams { pub const METHOD: &'static str = "DOM.undo"; }
4163
4164impl<'a> crate::CdpCommand<'a> for UndoParams {
4165 const METHOD: &'static str = "DOM.undo";
4166 type Response = crate::EmptyReturns;
4167}
4168
4169#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4172#[serde(rename_all = "camelCase")]
4173pub struct GetFrameOwnerParams<'a> {
4174 #[serde(rename = "frameId")]
4175 frame_id: crate::page::FrameId<'a>,
4176}
4177
4178impl<'a> GetFrameOwnerParams<'a> {
4179 pub fn builder(frame_id: crate::page::FrameId<'a>) -> GetFrameOwnerParamsBuilder<'a> {
4182 GetFrameOwnerParamsBuilder {
4183 frame_id: frame_id,
4184 }
4185 }
4186 pub fn frame_id(&self) -> &crate::page::FrameId<'a> { &self.frame_id }
4187}
4188
4189
4190pub struct GetFrameOwnerParamsBuilder<'a> {
4191 frame_id: crate::page::FrameId<'a>,
4192}
4193
4194impl<'a> GetFrameOwnerParamsBuilder<'a> {
4195 pub fn build(self) -> GetFrameOwnerParams<'a> {
4196 GetFrameOwnerParams {
4197 frame_id: self.frame_id,
4198 }
4199 }
4200}
4201
4202#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4205#[serde(rename_all = "camelCase")]
4206pub struct GetFrameOwnerReturns {
4207 #[serde(rename = "backendNodeId")]
4209 backend_node_id: BackendNodeId,
4210 #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
4212 node_id: Option<NodeId>,
4213}
4214
4215impl GetFrameOwnerReturns {
4216 pub fn builder(backend_node_id: BackendNodeId) -> GetFrameOwnerReturnsBuilder {
4219 GetFrameOwnerReturnsBuilder {
4220 backend_node_id: backend_node_id,
4221 node_id: None,
4222 }
4223 }
4224 pub fn backend_node_id(&self) -> &BackendNodeId { &self.backend_node_id }
4226 pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
4228}
4229
4230
4231pub struct GetFrameOwnerReturnsBuilder {
4232 backend_node_id: BackendNodeId,
4233 node_id: Option<NodeId>,
4234}
4235
4236impl GetFrameOwnerReturnsBuilder {
4237 pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
4239 pub fn build(self) -> GetFrameOwnerReturns {
4240 GetFrameOwnerReturns {
4241 backend_node_id: self.backend_node_id,
4242 node_id: self.node_id,
4243 }
4244 }
4245}
4246
4247impl<'a> GetFrameOwnerParams<'a> { pub const METHOD: &'static str = "DOM.getFrameOwner"; }
4248
4249impl<'a> crate::CdpCommand<'a> for GetFrameOwnerParams<'a> {
4250 const METHOD: &'static str = "DOM.getFrameOwner";
4251 type Response = GetFrameOwnerReturns;
4252}
4253
4254#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4261#[serde(rename_all = "camelCase")]
4262pub struct GetContainerForNodeParams<'a> {
4263 #[serde(rename = "nodeId")]
4264 node_id: NodeId,
4265 #[serde(skip_serializing_if = "Option::is_none", rename = "containerName")]
4266 container_name: Option<Cow<'a, str>>,
4267 #[serde(skip_serializing_if = "Option::is_none", rename = "physicalAxes")]
4268 physical_axes: Option<PhysicalAxes>,
4269 #[serde(skip_serializing_if = "Option::is_none", rename = "logicalAxes")]
4270 logical_axes: Option<LogicalAxes>,
4271 #[serde(skip_serializing_if = "Option::is_none", rename = "queriesScrollState")]
4272 queries_scroll_state: Option<bool>,
4273 #[serde(skip_serializing_if = "Option::is_none", rename = "queriesAnchored")]
4274 queries_anchored: Option<bool>,
4275}
4276
4277impl<'a> GetContainerForNodeParams<'a> {
4278 pub fn builder(node_id: NodeId) -> GetContainerForNodeParamsBuilder<'a> {
4281 GetContainerForNodeParamsBuilder {
4282 node_id: node_id,
4283 container_name: None,
4284 physical_axes: None,
4285 logical_axes: None,
4286 queries_scroll_state: None,
4287 queries_anchored: None,
4288 }
4289 }
4290 pub fn node_id(&self) -> &NodeId { &self.node_id }
4291 pub fn container_name(&self) -> Option<&str> { self.container_name.as_deref() }
4292 pub fn physical_axes(&self) -> Option<&PhysicalAxes> { self.physical_axes.as_ref() }
4293 pub fn logical_axes(&self) -> Option<&LogicalAxes> { self.logical_axes.as_ref() }
4294 pub fn queries_scroll_state(&self) -> Option<bool> { self.queries_scroll_state }
4295 pub fn queries_anchored(&self) -> Option<bool> { self.queries_anchored }
4296}
4297
4298
4299pub struct GetContainerForNodeParamsBuilder<'a> {
4300 node_id: NodeId,
4301 container_name: Option<Cow<'a, str>>,
4302 physical_axes: Option<PhysicalAxes>,
4303 logical_axes: Option<LogicalAxes>,
4304 queries_scroll_state: Option<bool>,
4305 queries_anchored: Option<bool>,
4306}
4307
4308impl<'a> GetContainerForNodeParamsBuilder<'a> {
4309 pub fn container_name(mut self, container_name: impl Into<Cow<'a, str>>) -> Self { self.container_name = Some(container_name.into()); self }
4310 pub fn physical_axes(mut self, physical_axes: impl Into<PhysicalAxes>) -> Self { self.physical_axes = Some(physical_axes.into()); self }
4311 pub fn logical_axes(mut self, logical_axes: impl Into<LogicalAxes>) -> Self { self.logical_axes = Some(logical_axes.into()); self }
4312 pub fn queries_scroll_state(mut self, queries_scroll_state: bool) -> Self { self.queries_scroll_state = Some(queries_scroll_state); self }
4313 pub fn queries_anchored(mut self, queries_anchored: bool) -> Self { self.queries_anchored = Some(queries_anchored); self }
4314 pub fn build(self) -> GetContainerForNodeParams<'a> {
4315 GetContainerForNodeParams {
4316 node_id: self.node_id,
4317 container_name: self.container_name,
4318 physical_axes: self.physical_axes,
4319 logical_axes: self.logical_axes,
4320 queries_scroll_state: self.queries_scroll_state,
4321 queries_anchored: self.queries_anchored,
4322 }
4323 }
4324}
4325
4326#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4333#[serde(rename_all = "camelCase")]
4334pub struct GetContainerForNodeReturns {
4335 #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
4337 node_id: Option<NodeId>,
4338}
4339
4340impl GetContainerForNodeReturns {
4341 pub fn builder() -> GetContainerForNodeReturnsBuilder {
4343 GetContainerForNodeReturnsBuilder {
4344 node_id: None,
4345 }
4346 }
4347 pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
4349}
4350
4351#[derive(Default)]
4352pub struct GetContainerForNodeReturnsBuilder {
4353 node_id: Option<NodeId>,
4354}
4355
4356impl GetContainerForNodeReturnsBuilder {
4357 pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
4359 pub fn build(self) -> GetContainerForNodeReturns {
4360 GetContainerForNodeReturns {
4361 node_id: self.node_id,
4362 }
4363 }
4364}
4365
4366impl<'a> GetContainerForNodeParams<'a> { pub const METHOD: &'static str = "DOM.getContainerForNode"; }
4367
4368impl<'a> crate::CdpCommand<'a> for GetContainerForNodeParams<'a> {
4369 const METHOD: &'static str = "DOM.getContainerForNode";
4370 type Response = GetContainerForNodeReturns;
4371}
4372
4373#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4377#[serde(rename_all = "camelCase")]
4378pub struct GetQueryingDescendantsForContainerParams {
4379 #[serde(rename = "nodeId")]
4381 node_id: NodeId,
4382}
4383
4384impl GetQueryingDescendantsForContainerParams {
4385 pub fn builder(node_id: NodeId) -> GetQueryingDescendantsForContainerParamsBuilder {
4388 GetQueryingDescendantsForContainerParamsBuilder {
4389 node_id: node_id,
4390 }
4391 }
4392 pub fn node_id(&self) -> &NodeId { &self.node_id }
4394}
4395
4396
4397pub struct GetQueryingDescendantsForContainerParamsBuilder {
4398 node_id: NodeId,
4399}
4400
4401impl GetQueryingDescendantsForContainerParamsBuilder {
4402 pub fn build(self) -> GetQueryingDescendantsForContainerParams {
4403 GetQueryingDescendantsForContainerParams {
4404 node_id: self.node_id,
4405 }
4406 }
4407}
4408
4409#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4413#[serde(rename_all = "camelCase")]
4414pub struct GetQueryingDescendantsForContainerReturns {
4415 #[serde(rename = "nodeIds")]
4417 node_ids: Vec<NodeId>,
4418}
4419
4420impl GetQueryingDescendantsForContainerReturns {
4421 pub fn builder(node_ids: Vec<NodeId>) -> GetQueryingDescendantsForContainerReturnsBuilder {
4424 GetQueryingDescendantsForContainerReturnsBuilder {
4425 node_ids: node_ids,
4426 }
4427 }
4428 pub fn node_ids(&self) -> &[NodeId] { &self.node_ids }
4430}
4431
4432
4433pub struct GetQueryingDescendantsForContainerReturnsBuilder {
4434 node_ids: Vec<NodeId>,
4435}
4436
4437impl GetQueryingDescendantsForContainerReturnsBuilder {
4438 pub fn build(self) -> GetQueryingDescendantsForContainerReturns {
4439 GetQueryingDescendantsForContainerReturns {
4440 node_ids: self.node_ids,
4441 }
4442 }
4443}
4444
4445impl GetQueryingDescendantsForContainerParams { pub const METHOD: &'static str = "DOM.getQueryingDescendantsForContainer"; }
4446
4447impl<'a> crate::CdpCommand<'a> for GetQueryingDescendantsForContainerParams {
4448 const METHOD: &'static str = "DOM.getQueryingDescendantsForContainer";
4449 type Response = GetQueryingDescendantsForContainerReturns;
4450}
4451
4452#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4456#[serde(rename_all = "camelCase")]
4457pub struct GetAnchorElementParams<'a> {
4458 #[serde(rename = "nodeId")]
4460 node_id: NodeId,
4461 #[serde(skip_serializing_if = "Option::is_none", rename = "anchorSpecifier")]
4466 anchor_specifier: Option<Cow<'a, str>>,
4467}
4468
4469impl<'a> GetAnchorElementParams<'a> {
4470 pub fn builder(node_id: NodeId) -> GetAnchorElementParamsBuilder<'a> {
4473 GetAnchorElementParamsBuilder {
4474 node_id: node_id,
4475 anchor_specifier: None,
4476 }
4477 }
4478 pub fn node_id(&self) -> &NodeId { &self.node_id }
4480 pub fn anchor_specifier(&self) -> Option<&str> { self.anchor_specifier.as_deref() }
4485}
4486
4487
4488pub struct GetAnchorElementParamsBuilder<'a> {
4489 node_id: NodeId,
4490 anchor_specifier: Option<Cow<'a, str>>,
4491}
4492
4493impl<'a> GetAnchorElementParamsBuilder<'a> {
4494 pub fn anchor_specifier(mut self, anchor_specifier: impl Into<Cow<'a, str>>) -> Self { self.anchor_specifier = Some(anchor_specifier.into()); self }
4499 pub fn build(self) -> GetAnchorElementParams<'a> {
4500 GetAnchorElementParams {
4501 node_id: self.node_id,
4502 anchor_specifier: self.anchor_specifier,
4503 }
4504 }
4505}
4506
4507#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4511#[serde(rename_all = "camelCase")]
4512pub struct GetAnchorElementReturns {
4513 #[serde(rename = "nodeId")]
4515 node_id: NodeId,
4516}
4517
4518impl GetAnchorElementReturns {
4519 pub fn builder(node_id: NodeId) -> GetAnchorElementReturnsBuilder {
4522 GetAnchorElementReturnsBuilder {
4523 node_id: node_id,
4524 }
4525 }
4526 pub fn node_id(&self) -> &NodeId { &self.node_id }
4528}
4529
4530
4531pub struct GetAnchorElementReturnsBuilder {
4532 node_id: NodeId,
4533}
4534
4535impl GetAnchorElementReturnsBuilder {
4536 pub fn build(self) -> GetAnchorElementReturns {
4537 GetAnchorElementReturns {
4538 node_id: self.node_id,
4539 }
4540 }
4541}
4542
4543impl<'a> GetAnchorElementParams<'a> { pub const METHOD: &'static str = "DOM.getAnchorElement"; }
4544
4545impl<'a> crate::CdpCommand<'a> for GetAnchorElementParams<'a> {
4546 const METHOD: &'static str = "DOM.getAnchorElement";
4547 type Response = GetAnchorElementReturns;
4548}
4549
4550#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4554#[serde(rename_all = "camelCase")]
4555pub struct ForceShowPopoverParams {
4556 #[serde(rename = "nodeId")]
4558 node_id: NodeId,
4559 enable: bool,
4562}
4563
4564impl ForceShowPopoverParams {
4565 pub fn builder(node_id: NodeId, enable: bool) -> ForceShowPopoverParamsBuilder {
4569 ForceShowPopoverParamsBuilder {
4570 node_id: node_id,
4571 enable: enable,
4572 }
4573 }
4574 pub fn node_id(&self) -> &NodeId { &self.node_id }
4576 pub fn enable(&self) -> bool { self.enable }
4579}
4580
4581
4582pub struct ForceShowPopoverParamsBuilder {
4583 node_id: NodeId,
4584 enable: bool,
4585}
4586
4587impl ForceShowPopoverParamsBuilder {
4588 pub fn build(self) -> ForceShowPopoverParams {
4589 ForceShowPopoverParams {
4590 node_id: self.node_id,
4591 enable: self.enable,
4592 }
4593 }
4594}
4595
4596#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4600#[serde(rename_all = "camelCase")]
4601pub struct ForceShowPopoverReturns {
4602 #[serde(rename = "nodeIds")]
4604 node_ids: Vec<NodeId>,
4605}
4606
4607impl ForceShowPopoverReturns {
4608 pub fn builder(node_ids: Vec<NodeId>) -> ForceShowPopoverReturnsBuilder {
4611 ForceShowPopoverReturnsBuilder {
4612 node_ids: node_ids,
4613 }
4614 }
4615 pub fn node_ids(&self) -> &[NodeId] { &self.node_ids }
4617}
4618
4619
4620pub struct ForceShowPopoverReturnsBuilder {
4621 node_ids: Vec<NodeId>,
4622}
4623
4624impl ForceShowPopoverReturnsBuilder {
4625 pub fn build(self) -> ForceShowPopoverReturns {
4626 ForceShowPopoverReturns {
4627 node_ids: self.node_ids,
4628 }
4629 }
4630}
4631
4632impl ForceShowPopoverParams { pub const METHOD: &'static str = "DOM.forceShowPopover"; }
4633
4634impl<'a> crate::CdpCommand<'a> for ForceShowPopoverParams {
4635 const METHOD: &'static str = "DOM.forceShowPopover";
4636 type Response = ForceShowPopoverReturns;
4637}