use serde::{Serialize, Deserialize};
use serde_json::Value as JsonValue;
use std::borrow::Cow;
pub type NodeId = i64;
pub type BackendNodeId = i64;
pub type StyleSheetId<'a> = Cow<'a, str>;
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct BackendNode<'a> {
#[serde(rename = "nodeType")]
node_type: i64,
#[serde(rename = "nodeName")]
node_name: Cow<'a, str>,
#[serde(rename = "backendNodeId")]
backend_node_id: BackendNodeId,
}
impl<'a> BackendNode<'a> {
pub fn builder(node_type: i64, node_name: impl Into<Cow<'a, str>>, backend_node_id: BackendNodeId) -> BackendNodeBuilder<'a> {
BackendNodeBuilder {
node_type: node_type,
node_name: node_name.into(),
backend_node_id: backend_node_id,
}
}
pub fn node_type(&self) -> i64 { self.node_type }
pub fn node_name(&self) -> &str { self.node_name.as_ref() }
pub fn backend_node_id(&self) -> &BackendNodeId { &self.backend_node_id }
}
pub struct BackendNodeBuilder<'a> {
node_type: i64,
node_name: Cow<'a, str>,
backend_node_id: BackendNodeId,
}
impl<'a> BackendNodeBuilder<'a> {
pub fn build(self) -> BackendNode<'a> {
BackendNode {
node_type: self.node_type,
node_name: self.node_name,
backend_node_id: self.backend_node_id,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum PseudoType {
#[default]
#[serde(rename = "first-line")]
FirstLine,
#[serde(rename = "first-letter")]
FirstLetter,
#[serde(rename = "checkmark")]
Checkmark,
#[serde(rename = "before")]
Before,
#[serde(rename = "after")]
After,
#[serde(rename = "expand-icon")]
ExpandIcon,
#[serde(rename = "picker-icon")]
PickerIcon,
#[serde(rename = "interest-button")]
InterestButton,
#[serde(rename = "marker")]
Marker,
#[serde(rename = "backdrop")]
Backdrop,
#[serde(rename = "column")]
Column,
#[serde(rename = "selection")]
Selection,
#[serde(rename = "search-text")]
SearchText,
#[serde(rename = "target-text")]
TargetText,
#[serde(rename = "spelling-error")]
SpellingError,
#[serde(rename = "grammar-error")]
GrammarError,
#[serde(rename = "highlight")]
Highlight,
#[serde(rename = "first-line-inherited")]
FirstLineInherited,
#[serde(rename = "scroll-marker")]
ScrollMarker,
#[serde(rename = "scroll-marker-group")]
ScrollMarkerGroup,
#[serde(rename = "scroll-button")]
ScrollButton,
#[serde(rename = "scrollbar")]
Scrollbar,
#[serde(rename = "scrollbar-thumb")]
ScrollbarThumb,
#[serde(rename = "scrollbar-button")]
ScrollbarButton,
#[serde(rename = "scrollbar-track")]
ScrollbarTrack,
#[serde(rename = "scrollbar-track-piece")]
ScrollbarTrackPiece,
#[serde(rename = "scrollbar-corner")]
ScrollbarCorner,
#[serde(rename = "resizer")]
Resizer,
#[serde(rename = "input-list-button")]
InputListButton,
#[serde(rename = "view-transition")]
ViewTransition,
#[serde(rename = "view-transition-group")]
ViewTransitionGroup,
#[serde(rename = "view-transition-image-pair")]
ViewTransitionImagePair,
#[serde(rename = "view-transition-group-children")]
ViewTransitionGroupChildren,
#[serde(rename = "view-transition-old")]
ViewTransitionOld,
#[serde(rename = "view-transition-new")]
ViewTransitionNew,
#[serde(rename = "placeholder")]
Placeholder,
#[serde(rename = "file-selector-button")]
FileSelectorButton,
#[serde(rename = "details-content")]
DetailsContent,
#[serde(rename = "picker")]
Picker,
#[serde(rename = "permission-icon")]
PermissionIcon,
#[serde(rename = "overscroll-area-parent")]
OverscrollAreaParent,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum ShadowRootType {
#[default]
#[serde(rename = "user-agent")]
UserAgent,
#[serde(rename = "open")]
Open,
#[serde(rename = "closed")]
Closed,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum CompatibilityMode {
#[default]
#[serde(rename = "QuirksMode")]
QuirksMode,
#[serde(rename = "LimitedQuirksMode")]
LimitedQuirksMode,
#[serde(rename = "NoQuirksMode")]
NoQuirksMode,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum PhysicalAxes {
#[default]
#[serde(rename = "Horizontal")]
Horizontal,
#[serde(rename = "Vertical")]
Vertical,
#[serde(rename = "Both")]
Both,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum LogicalAxes {
#[default]
#[serde(rename = "Inline")]
Inline,
#[serde(rename = "Block")]
Block,
#[serde(rename = "Both")]
Both,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum ScrollOrientation {
#[default]
#[serde(rename = "horizontal")]
Horizontal,
#[serde(rename = "vertical")]
Vertical,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct Node<'a> {
#[serde(rename = "nodeId")]
node_id: NodeId,
#[serde(skip_serializing_if = "Option::is_none", rename = "parentId")]
parent_id: Option<NodeId>,
#[serde(rename = "backendNodeId")]
backend_node_id: BackendNodeId,
#[serde(rename = "nodeType")]
node_type: i64,
#[serde(rename = "nodeName")]
node_name: Cow<'a, str>,
#[serde(rename = "localName")]
local_name: Cow<'a, str>,
#[serde(rename = "nodeValue")]
node_value: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none", rename = "childNodeCount")]
child_node_count: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
children: Option<Vec<Box<Node<'a>>>>,
#[serde(skip_serializing_if = "Option::is_none")]
attributes: Option<Vec<Cow<'a, str>>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "documentURL")]
document_url: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "baseURL")]
base_url: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "publicId")]
public_id: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "systemId")]
system_id: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "internalSubset")]
internal_subset: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "xmlVersion")]
xml_version: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none")]
name: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none")]
value: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "pseudoType")]
pseudo_type: Option<PseudoType>,
#[serde(skip_serializing_if = "Option::is_none", rename = "pseudoIdentifier")]
pseudo_identifier: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "shadowRootType")]
shadow_root_type: Option<ShadowRootType>,
#[serde(skip_serializing_if = "Option::is_none", rename = "frameId")]
frame_id: Option<crate::page::FrameId<'a>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "contentDocument")]
content_document: Option<Box<Node<'a>>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "shadowRoots")]
shadow_roots: Option<Vec<Box<Node<'a>>>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "templateContent")]
template_content: Option<Box<Node<'a>>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "pseudoElements")]
pseudo_elements: Option<Vec<Box<Node<'a>>>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "importedDocument")]
imported_document: Option<Box<Node<'a>>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "distributedNodes")]
distributed_nodes: Option<Vec<BackendNode<'a>>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "isSVG")]
is_svg: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", rename = "compatibilityMode")]
compatibility_mode: Option<CompatibilityMode>,
#[serde(skip_serializing_if = "Option::is_none", rename = "assignedSlot")]
assigned_slot: Option<BackendNode<'a>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "isScrollable")]
is_scrollable: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", rename = "affectedByStartingStyles")]
affected_by_starting_styles: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", rename = "adoptedStyleSheets")]
adopted_style_sheets: Option<Vec<StyleSheetId<'a>>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "adProvenance")]
ad_provenance: Option<crate::network::AdProvenance<'a>>,
}
impl<'a> Node<'a> {
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> {
NodeBuilder {
node_id: node_id,
parent_id: None,
backend_node_id: backend_node_id,
node_type: node_type,
node_name: node_name.into(),
local_name: local_name.into(),
node_value: node_value.into(),
child_node_count: None,
children: None,
attributes: None,
document_url: None,
base_url: None,
public_id: None,
system_id: None,
internal_subset: None,
xml_version: None,
name: None,
value: None,
pseudo_type: None,
pseudo_identifier: None,
shadow_root_type: None,
frame_id: None,
content_document: None,
shadow_roots: None,
template_content: None,
pseudo_elements: None,
imported_document: None,
distributed_nodes: None,
is_svg: None,
compatibility_mode: None,
assigned_slot: None,
is_scrollable: None,
affected_by_starting_styles: None,
adopted_style_sheets: None,
ad_provenance: None,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn parent_id(&self) -> Option<&NodeId> { self.parent_id.as_ref() }
pub fn backend_node_id(&self) -> &BackendNodeId { &self.backend_node_id }
pub fn node_type(&self) -> i64 { self.node_type }
pub fn node_name(&self) -> &str { self.node_name.as_ref() }
pub fn local_name(&self) -> &str { self.local_name.as_ref() }
pub fn node_value(&self) -> &str { self.node_value.as_ref() }
pub fn child_node_count(&self) -> Option<u64> { self.child_node_count }
pub fn children(&self) -> Option<&[Box<Node<'a>>]> { self.children.as_deref() }
pub fn attributes(&self) -> Option<&[Cow<'a, str>]> { self.attributes.as_deref() }
pub fn document_url(&self) -> Option<&str> { self.document_url.as_deref() }
pub fn base_url(&self) -> Option<&str> { self.base_url.as_deref() }
pub fn public_id(&self) -> Option<&str> { self.public_id.as_deref() }
pub fn system_id(&self) -> Option<&str> { self.system_id.as_deref() }
pub fn internal_subset(&self) -> Option<&str> { self.internal_subset.as_deref() }
pub fn xml_version(&self) -> Option<&str> { self.xml_version.as_deref() }
pub fn name(&self) -> Option<&str> { self.name.as_deref() }
pub fn value(&self) -> Option<&str> { self.value.as_deref() }
pub fn pseudo_type(&self) -> Option<&PseudoType> { self.pseudo_type.as_ref() }
pub fn pseudo_identifier(&self) -> Option<&str> { self.pseudo_identifier.as_deref() }
pub fn shadow_root_type(&self) -> Option<&ShadowRootType> { self.shadow_root_type.as_ref() }
pub fn frame_id(&self) -> Option<&crate::page::FrameId<'a>> { self.frame_id.as_ref() }
pub fn content_document(&self) -> Option<&Node<'a>> { self.content_document.as_deref() }
pub fn shadow_roots(&self) -> Option<&[Box<Node<'a>>]> { self.shadow_roots.as_deref() }
pub fn template_content(&self) -> Option<&Node<'a>> { self.template_content.as_deref() }
pub fn pseudo_elements(&self) -> Option<&[Box<Node<'a>>]> { self.pseudo_elements.as_deref() }
pub fn imported_document(&self) -> Option<&Node<'a>> { self.imported_document.as_deref() }
pub fn distributed_nodes(&self) -> Option<&[BackendNode<'a>]> { self.distributed_nodes.as_deref() }
pub fn is_svg(&self) -> Option<bool> { self.is_svg }
pub fn compatibility_mode(&self) -> Option<&CompatibilityMode> { self.compatibility_mode.as_ref() }
pub fn assigned_slot(&self) -> Option<&BackendNode<'a>> { self.assigned_slot.as_ref() }
pub fn is_scrollable(&self) -> Option<bool> { self.is_scrollable }
pub fn affected_by_starting_styles(&self) -> Option<bool> { self.affected_by_starting_styles }
pub fn adopted_style_sheets(&self) -> Option<&[StyleSheetId<'a>]> { self.adopted_style_sheets.as_deref() }
pub fn ad_provenance(&self) -> Option<&crate::network::AdProvenance<'a>> { self.ad_provenance.as_ref() }
}
pub struct NodeBuilder<'a> {
node_id: NodeId,
parent_id: Option<NodeId>,
backend_node_id: BackendNodeId,
node_type: i64,
node_name: Cow<'a, str>,
local_name: Cow<'a, str>,
node_value: Cow<'a, str>,
child_node_count: Option<u64>,
children: Option<Vec<Box<Node<'a>>>>,
attributes: Option<Vec<Cow<'a, str>>>,
document_url: Option<Cow<'a, str>>,
base_url: Option<Cow<'a, str>>,
public_id: Option<Cow<'a, str>>,
system_id: Option<Cow<'a, str>>,
internal_subset: Option<Cow<'a, str>>,
xml_version: Option<Cow<'a, str>>,
name: Option<Cow<'a, str>>,
value: Option<Cow<'a, str>>,
pseudo_type: Option<PseudoType>,
pseudo_identifier: Option<Cow<'a, str>>,
shadow_root_type: Option<ShadowRootType>,
frame_id: Option<crate::page::FrameId<'a>>,
content_document: Option<Box<Node<'a>>>,
shadow_roots: Option<Vec<Box<Node<'a>>>>,
template_content: Option<Box<Node<'a>>>,
pseudo_elements: Option<Vec<Box<Node<'a>>>>,
imported_document: Option<Box<Node<'a>>>,
distributed_nodes: Option<Vec<BackendNode<'a>>>,
is_svg: Option<bool>,
compatibility_mode: Option<CompatibilityMode>,
assigned_slot: Option<BackendNode<'a>>,
is_scrollable: Option<bool>,
affected_by_starting_styles: Option<bool>,
adopted_style_sheets: Option<Vec<StyleSheetId<'a>>>,
ad_provenance: Option<crate::network::AdProvenance<'a>>,
}
impl<'a> NodeBuilder<'a> {
pub fn parent_id(mut self, parent_id: NodeId) -> Self { self.parent_id = Some(parent_id); self }
pub fn child_node_count(mut self, child_node_count: u64) -> Self { self.child_node_count = Some(child_node_count); self }
pub fn children(mut self, children: Vec<Box<Node<'a>>>) -> Self { self.children = Some(children); self }
pub fn attributes(mut self, attributes: Vec<Cow<'a, str>>) -> Self { self.attributes = Some(attributes); self }
pub fn document_url(mut self, document_url: impl Into<Cow<'a, str>>) -> Self { self.document_url = Some(document_url.into()); self }
pub fn base_url(mut self, base_url: impl Into<Cow<'a, str>>) -> Self { self.base_url = Some(base_url.into()); self }
pub fn public_id(mut self, public_id: impl Into<Cow<'a, str>>) -> Self { self.public_id = Some(public_id.into()); self }
pub fn system_id(mut self, system_id: impl Into<Cow<'a, str>>) -> Self { self.system_id = Some(system_id.into()); self }
pub fn internal_subset(mut self, internal_subset: impl Into<Cow<'a, str>>) -> Self { self.internal_subset = Some(internal_subset.into()); self }
pub fn xml_version(mut self, xml_version: impl Into<Cow<'a, str>>) -> Self { self.xml_version = Some(xml_version.into()); self }
pub fn name(mut self, name: impl Into<Cow<'a, str>>) -> Self { self.name = Some(name.into()); self }
pub fn value(mut self, value: impl Into<Cow<'a, str>>) -> Self { self.value = Some(value.into()); self }
pub fn pseudo_type(mut self, pseudo_type: impl Into<PseudoType>) -> Self { self.pseudo_type = Some(pseudo_type.into()); self }
pub fn pseudo_identifier(mut self, pseudo_identifier: impl Into<Cow<'a, str>>) -> Self { self.pseudo_identifier = Some(pseudo_identifier.into()); self }
pub fn shadow_root_type(mut self, shadow_root_type: impl Into<ShadowRootType>) -> Self { self.shadow_root_type = Some(shadow_root_type.into()); self }
pub fn frame_id(mut self, frame_id: crate::page::FrameId<'a>) -> Self { self.frame_id = Some(frame_id); self }
pub fn content_document(mut self, content_document: Box<Node<'a>>) -> Self { self.content_document = Some(content_document); self }
pub fn shadow_roots(mut self, shadow_roots: Vec<Box<Node<'a>>>) -> Self { self.shadow_roots = Some(shadow_roots); self }
pub fn template_content(mut self, template_content: Box<Node<'a>>) -> Self { self.template_content = Some(template_content); self }
pub fn pseudo_elements(mut self, pseudo_elements: Vec<Box<Node<'a>>>) -> Self { self.pseudo_elements = Some(pseudo_elements); self }
pub fn imported_document(mut self, imported_document: Box<Node<'a>>) -> Self { self.imported_document = Some(imported_document); self }
pub fn distributed_nodes(mut self, distributed_nodes: Vec<BackendNode<'a>>) -> Self { self.distributed_nodes = Some(distributed_nodes); self }
pub fn is_svg(mut self, is_svg: bool) -> Self { self.is_svg = Some(is_svg); self }
pub fn compatibility_mode(mut self, compatibility_mode: impl Into<CompatibilityMode>) -> Self { self.compatibility_mode = Some(compatibility_mode.into()); self }
pub fn assigned_slot(mut self, assigned_slot: BackendNode<'a>) -> Self { self.assigned_slot = Some(assigned_slot); self }
pub fn is_scrollable(mut self, is_scrollable: bool) -> Self { self.is_scrollable = Some(is_scrollable); self }
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 }
pub fn adopted_style_sheets(mut self, adopted_style_sheets: Vec<StyleSheetId<'a>>) -> Self { self.adopted_style_sheets = Some(adopted_style_sheets); self }
pub fn ad_provenance(mut self, ad_provenance: crate::network::AdProvenance<'a>) -> Self { self.ad_provenance = Some(ad_provenance); self }
pub fn build(self) -> Node<'a> {
Node {
node_id: self.node_id,
parent_id: self.parent_id,
backend_node_id: self.backend_node_id,
node_type: self.node_type,
node_name: self.node_name,
local_name: self.local_name,
node_value: self.node_value,
child_node_count: self.child_node_count,
children: self.children,
attributes: self.attributes,
document_url: self.document_url,
base_url: self.base_url,
public_id: self.public_id,
system_id: self.system_id,
internal_subset: self.internal_subset,
xml_version: self.xml_version,
name: self.name,
value: self.value,
pseudo_type: self.pseudo_type,
pseudo_identifier: self.pseudo_identifier,
shadow_root_type: self.shadow_root_type,
frame_id: self.frame_id,
content_document: self.content_document,
shadow_roots: self.shadow_roots,
template_content: self.template_content,
pseudo_elements: self.pseudo_elements,
imported_document: self.imported_document,
distributed_nodes: self.distributed_nodes,
is_svg: self.is_svg,
compatibility_mode: self.compatibility_mode,
assigned_slot: self.assigned_slot,
is_scrollable: self.is_scrollable,
affected_by_starting_styles: self.affected_by_starting_styles,
adopted_style_sheets: self.adopted_style_sheets,
ad_provenance: self.ad_provenance,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DetachedElementInfo<'a> {
#[serde(rename = "treeNode")]
tree_node: Node<'a>,
#[serde(rename = "retainedNodeIds")]
retained_node_ids: Vec<NodeId>,
}
impl<'a> DetachedElementInfo<'a> {
pub fn builder(tree_node: Node<'a>, retained_node_ids: Vec<NodeId>) -> DetachedElementInfoBuilder<'a> {
DetachedElementInfoBuilder {
tree_node: tree_node,
retained_node_ids: retained_node_ids,
}
}
pub fn tree_node(&self) -> &Node<'a> { &self.tree_node }
pub fn retained_node_ids(&self) -> &[NodeId] { &self.retained_node_ids }
}
pub struct DetachedElementInfoBuilder<'a> {
tree_node: Node<'a>,
retained_node_ids: Vec<NodeId>,
}
impl<'a> DetachedElementInfoBuilder<'a> {
pub fn build(self) -> DetachedElementInfo<'a> {
DetachedElementInfo {
tree_node: self.tree_node,
retained_node_ids: self.retained_node_ids,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RGBA {
r: i64,
g: i64,
b: i64,
#[serde(skip_serializing_if = "Option::is_none")]
a: Option<f64>,
}
impl RGBA {
pub fn builder(r: i64, g: i64, b: i64) -> RGBABuilder {
RGBABuilder {
r: r,
g: g,
b: b,
a: None,
}
}
pub fn r(&self) -> i64 { self.r }
pub fn g(&self) -> i64 { self.g }
pub fn b(&self) -> i64 { self.b }
pub fn a(&self) -> Option<f64> { self.a }
}
pub struct RGBABuilder {
r: i64,
g: i64,
b: i64,
a: Option<f64>,
}
impl RGBABuilder {
pub fn a(mut self, a: f64) -> Self { self.a = Some(a); self }
pub fn build(self) -> RGBA {
RGBA {
r: self.r,
g: self.g,
b: self.b,
a: self.a,
}
}
}
pub type Quad = Vec<f64>;
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct BoxModel {
content: Quad,
padding: Quad,
border: Quad,
margin: Quad,
width: u64,
height: i64,
#[serde(skip_serializing_if = "Option::is_none", rename = "shapeOutside")]
shape_outside: Option<ShapeOutsideInfo>,
}
impl BoxModel {
pub fn builder(content: Quad, padding: Quad, border: Quad, margin: Quad, width: u64, height: i64) -> BoxModelBuilder {
BoxModelBuilder {
content: content,
padding: padding,
border: border,
margin: margin,
width: width,
height: height,
shape_outside: None,
}
}
pub fn content(&self) -> &Quad { &self.content }
pub fn padding(&self) -> &Quad { &self.padding }
pub fn border(&self) -> &Quad { &self.border }
pub fn margin(&self) -> &Quad { &self.margin }
pub fn width(&self) -> u64 { self.width }
pub fn height(&self) -> i64 { self.height }
pub fn shape_outside(&self) -> Option<&ShapeOutsideInfo> { self.shape_outside.as_ref() }
}
pub struct BoxModelBuilder {
content: Quad,
padding: Quad,
border: Quad,
margin: Quad,
width: u64,
height: i64,
shape_outside: Option<ShapeOutsideInfo>,
}
impl BoxModelBuilder {
pub fn shape_outside(mut self, shape_outside: ShapeOutsideInfo) -> Self { self.shape_outside = Some(shape_outside); self }
pub fn build(self) -> BoxModel {
BoxModel {
content: self.content,
padding: self.padding,
border: self.border,
margin: self.margin,
width: self.width,
height: self.height,
shape_outside: self.shape_outside,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ShapeOutsideInfo {
bounds: Quad,
shape: Vec<JsonValue>,
#[serde(rename = "marginShape")]
margin_shape: Vec<JsonValue>,
}
impl ShapeOutsideInfo {
pub fn builder(bounds: Quad, shape: Vec<JsonValue>, margin_shape: Vec<JsonValue>) -> ShapeOutsideInfoBuilder {
ShapeOutsideInfoBuilder {
bounds: bounds,
shape: shape,
margin_shape: margin_shape,
}
}
pub fn bounds(&self) -> &Quad { &self.bounds }
pub fn shape(&self) -> &[JsonValue] { &self.shape }
pub fn margin_shape(&self) -> &[JsonValue] { &self.margin_shape }
}
pub struct ShapeOutsideInfoBuilder {
bounds: Quad,
shape: Vec<JsonValue>,
margin_shape: Vec<JsonValue>,
}
impl ShapeOutsideInfoBuilder {
pub fn build(self) -> ShapeOutsideInfo {
ShapeOutsideInfo {
bounds: self.bounds,
shape: self.shape,
margin_shape: self.margin_shape,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct Rect {
x: f64,
y: f64,
width: f64,
height: f64,
}
impl Rect {
pub fn builder(x: f64, y: f64, width: f64, height: f64) -> RectBuilder {
RectBuilder {
x: x,
y: y,
width: width,
height: height,
}
}
pub fn x(&self) -> f64 { self.x }
pub fn y(&self) -> f64 { self.y }
pub fn width(&self) -> f64 { self.width }
pub fn height(&self) -> f64 { self.height }
}
pub struct RectBuilder {
x: f64,
y: f64,
width: f64,
height: f64,
}
impl RectBuilder {
pub fn build(self) -> Rect {
Rect {
x: self.x,
y: self.y,
width: self.width,
height: self.height,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSComputedStyleProperty<'a> {
name: Cow<'a, str>,
value: Cow<'a, str>,
}
impl<'a> CSSComputedStyleProperty<'a> {
pub fn builder(name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> CSSComputedStylePropertyBuilder<'a> {
CSSComputedStylePropertyBuilder {
name: name.into(),
value: value.into(),
}
}
pub fn name(&self) -> &str { self.name.as_ref() }
pub fn value(&self) -> &str { self.value.as_ref() }
}
pub struct CSSComputedStylePropertyBuilder<'a> {
name: Cow<'a, str>,
value: Cow<'a, str>,
}
impl<'a> CSSComputedStylePropertyBuilder<'a> {
pub fn build(self) -> CSSComputedStyleProperty<'a> {
CSSComputedStyleProperty {
name: self.name,
value: self.value,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CollectClassNamesFromSubtreeParams {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl CollectClassNamesFromSubtreeParams {
pub fn builder(node_id: NodeId) -> CollectClassNamesFromSubtreeParamsBuilder {
CollectClassNamesFromSubtreeParamsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct CollectClassNamesFromSubtreeParamsBuilder {
node_id: NodeId,
}
impl CollectClassNamesFromSubtreeParamsBuilder {
pub fn build(self) -> CollectClassNamesFromSubtreeParams {
CollectClassNamesFromSubtreeParams {
node_id: self.node_id,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CollectClassNamesFromSubtreeReturns<'a> {
#[serde(rename = "classNames")]
class_names: Vec<Cow<'a, str>>,
}
impl<'a> CollectClassNamesFromSubtreeReturns<'a> {
pub fn builder(class_names: Vec<Cow<'a, str>>) -> CollectClassNamesFromSubtreeReturnsBuilder<'a> {
CollectClassNamesFromSubtreeReturnsBuilder {
class_names: class_names,
}
}
pub fn class_names(&self) -> &[Cow<'a, str>] { &self.class_names }
}
pub struct CollectClassNamesFromSubtreeReturnsBuilder<'a> {
class_names: Vec<Cow<'a, str>>,
}
impl<'a> CollectClassNamesFromSubtreeReturnsBuilder<'a> {
pub fn build(self) -> CollectClassNamesFromSubtreeReturns<'a> {
CollectClassNamesFromSubtreeReturns {
class_names: self.class_names,
}
}
}
impl CollectClassNamesFromSubtreeParams { pub const METHOD: &'static str = "DOM.collectClassNamesFromSubtree"; }
impl<'a> crate::CdpCommand<'a> for CollectClassNamesFromSubtreeParams {
const METHOD: &'static str = "DOM.collectClassNamesFromSubtree";
type Response = CollectClassNamesFromSubtreeReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CopyToParams {
#[serde(rename = "nodeId")]
node_id: NodeId,
#[serde(rename = "targetNodeId")]
target_node_id: NodeId,
#[serde(skip_serializing_if = "Option::is_none", rename = "insertBeforeNodeId")]
insert_before_node_id: Option<NodeId>,
}
impl CopyToParams {
pub fn builder(node_id: NodeId, target_node_id: NodeId) -> CopyToParamsBuilder {
CopyToParamsBuilder {
node_id: node_id,
target_node_id: target_node_id,
insert_before_node_id: None,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn target_node_id(&self) -> &NodeId { &self.target_node_id }
pub fn insert_before_node_id(&self) -> Option<&NodeId> { self.insert_before_node_id.as_ref() }
}
pub struct CopyToParamsBuilder {
node_id: NodeId,
target_node_id: NodeId,
insert_before_node_id: Option<NodeId>,
}
impl CopyToParamsBuilder {
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 }
pub fn build(self) -> CopyToParams {
CopyToParams {
node_id: self.node_id,
target_node_id: self.target_node_id,
insert_before_node_id: self.insert_before_node_id,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CopyToReturns {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl CopyToReturns {
pub fn builder(node_id: NodeId) -> CopyToReturnsBuilder {
CopyToReturnsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct CopyToReturnsBuilder {
node_id: NodeId,
}
impl CopyToReturnsBuilder {
pub fn build(self) -> CopyToReturns {
CopyToReturns {
node_id: self.node_id,
}
}
}
impl CopyToParams { pub const METHOD: &'static str = "DOM.copyTo"; }
impl<'a> crate::CdpCommand<'a> for CopyToParams {
const METHOD: &'static str = "DOM.copyTo";
type Response = CopyToReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DescribeNodeParams<'a> {
#[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
node_id: Option<NodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
backend_node_id: Option<BackendNodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
object_id: Option<crate::runtime::RemoteObjectId<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
depth: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pierce: Option<bool>,
}
impl<'a> DescribeNodeParams<'a> {
pub fn builder() -> DescribeNodeParamsBuilder<'a> {
DescribeNodeParamsBuilder {
node_id: None,
backend_node_id: None,
object_id: None,
depth: None,
pierce: None,
}
}
pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
pub fn backend_node_id(&self) -> Option<&BackendNodeId> { self.backend_node_id.as_ref() }
pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
pub fn depth(&self) -> Option<i64> { self.depth }
pub fn pierce(&self) -> Option<bool> { self.pierce }
}
#[derive(Default)]
pub struct DescribeNodeParamsBuilder<'a> {
node_id: Option<NodeId>,
backend_node_id: Option<BackendNodeId>,
object_id: Option<crate::runtime::RemoteObjectId<'a>>,
depth: Option<i64>,
pierce: Option<bool>,
}
impl<'a> DescribeNodeParamsBuilder<'a> {
pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
pub fn backend_node_id(mut self, backend_node_id: BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
pub fn depth(mut self, depth: i64) -> Self { self.depth = Some(depth); self }
pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
pub fn build(self) -> DescribeNodeParams<'a> {
DescribeNodeParams {
node_id: self.node_id,
backend_node_id: self.backend_node_id,
object_id: self.object_id,
depth: self.depth,
pierce: self.pierce,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DescribeNodeReturns<'a> {
node: Node<'a>,
}
impl<'a> DescribeNodeReturns<'a> {
pub fn builder(node: Node<'a>) -> DescribeNodeReturnsBuilder<'a> {
DescribeNodeReturnsBuilder {
node: node,
}
}
pub fn node(&self) -> &Node<'a> { &self.node }
}
pub struct DescribeNodeReturnsBuilder<'a> {
node: Node<'a>,
}
impl<'a> DescribeNodeReturnsBuilder<'a> {
pub fn build(self) -> DescribeNodeReturns<'a> {
DescribeNodeReturns {
node: self.node,
}
}
}
impl<'a> DescribeNodeParams<'a> { pub const METHOD: &'static str = "DOM.describeNode"; }
impl<'a> crate::CdpCommand<'a> for DescribeNodeParams<'a> {
const METHOD: &'static str = "DOM.describeNode";
type Response = DescribeNodeReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ScrollIntoViewIfNeededParams<'a> {
#[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
node_id: Option<NodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
backend_node_id: Option<BackendNodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
object_id: Option<crate::runtime::RemoteObjectId<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
rect: Option<Rect>,
}
impl<'a> ScrollIntoViewIfNeededParams<'a> {
pub fn builder() -> ScrollIntoViewIfNeededParamsBuilder<'a> {
ScrollIntoViewIfNeededParamsBuilder {
node_id: None,
backend_node_id: None,
object_id: None,
rect: None,
}
}
pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
pub fn backend_node_id(&self) -> Option<&BackendNodeId> { self.backend_node_id.as_ref() }
pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
pub fn rect(&self) -> Option<&Rect> { self.rect.as_ref() }
}
#[derive(Default)]
pub struct ScrollIntoViewIfNeededParamsBuilder<'a> {
node_id: Option<NodeId>,
backend_node_id: Option<BackendNodeId>,
object_id: Option<crate::runtime::RemoteObjectId<'a>>,
rect: Option<Rect>,
}
impl<'a> ScrollIntoViewIfNeededParamsBuilder<'a> {
pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
pub fn backend_node_id(mut self, backend_node_id: BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
pub fn rect(mut self, rect: Rect) -> Self { self.rect = Some(rect); self }
pub fn build(self) -> ScrollIntoViewIfNeededParams<'a> {
ScrollIntoViewIfNeededParams {
node_id: self.node_id,
backend_node_id: self.backend_node_id,
object_id: self.object_id,
rect: self.rect,
}
}
}
impl<'a> ScrollIntoViewIfNeededParams<'a> { pub const METHOD: &'static str = "DOM.scrollIntoViewIfNeeded"; }
impl<'a> crate::CdpCommand<'a> for ScrollIntoViewIfNeededParams<'a> {
const METHOD: &'static str = "DOM.scrollIntoViewIfNeeded";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct DisableParams {}
impl DisableParams { pub const METHOD: &'static str = "DOM.disable"; }
impl<'a> crate::CdpCommand<'a> for DisableParams {
const METHOD: &'static str = "DOM.disable";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DiscardSearchResultsParams<'a> {
#[serde(rename = "searchId")]
search_id: Cow<'a, str>,
}
impl<'a> DiscardSearchResultsParams<'a> {
pub fn builder(search_id: impl Into<Cow<'a, str>>) -> DiscardSearchResultsParamsBuilder<'a> {
DiscardSearchResultsParamsBuilder {
search_id: search_id.into(),
}
}
pub fn search_id(&self) -> &str { self.search_id.as_ref() }
}
pub struct DiscardSearchResultsParamsBuilder<'a> {
search_id: Cow<'a, str>,
}
impl<'a> DiscardSearchResultsParamsBuilder<'a> {
pub fn build(self) -> DiscardSearchResultsParams<'a> {
DiscardSearchResultsParams {
search_id: self.search_id,
}
}
}
impl<'a> DiscardSearchResultsParams<'a> { pub const METHOD: &'static str = "DOM.discardSearchResults"; }
impl<'a> crate::CdpCommand<'a> for DiscardSearchResultsParams<'a> {
const METHOD: &'static str = "DOM.discardSearchResults";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct EnableParams<'a> {
#[serde(skip_serializing_if = "Option::is_none", rename = "includeWhitespace")]
include_whitespace: Option<Cow<'a, str>>,
}
impl<'a> EnableParams<'a> {
pub fn builder() -> EnableParamsBuilder<'a> {
EnableParamsBuilder {
include_whitespace: None,
}
}
pub fn include_whitespace(&self) -> Option<&str> { self.include_whitespace.as_deref() }
}
#[derive(Default)]
pub struct EnableParamsBuilder<'a> {
include_whitespace: Option<Cow<'a, str>>,
}
impl<'a> EnableParamsBuilder<'a> {
pub fn include_whitespace(mut self, include_whitespace: impl Into<Cow<'a, str>>) -> Self { self.include_whitespace = Some(include_whitespace.into()); self }
pub fn build(self) -> EnableParams<'a> {
EnableParams {
include_whitespace: self.include_whitespace,
}
}
}
impl<'a> EnableParams<'a> { pub const METHOD: &'static str = "DOM.enable"; }
impl<'a> crate::CdpCommand<'a> for EnableParams<'a> {
const METHOD: &'static str = "DOM.enable";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct FocusParams<'a> {
#[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
node_id: Option<NodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
backend_node_id: Option<BackendNodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
object_id: Option<crate::runtime::RemoteObjectId<'a>>,
}
impl<'a> FocusParams<'a> {
pub fn builder() -> FocusParamsBuilder<'a> {
FocusParamsBuilder {
node_id: None,
backend_node_id: None,
object_id: None,
}
}
pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
pub fn backend_node_id(&self) -> Option<&BackendNodeId> { self.backend_node_id.as_ref() }
pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
}
#[derive(Default)]
pub struct FocusParamsBuilder<'a> {
node_id: Option<NodeId>,
backend_node_id: Option<BackendNodeId>,
object_id: Option<crate::runtime::RemoteObjectId<'a>>,
}
impl<'a> FocusParamsBuilder<'a> {
pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
pub fn backend_node_id(mut self, backend_node_id: BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
pub fn build(self) -> FocusParams<'a> {
FocusParams {
node_id: self.node_id,
backend_node_id: self.backend_node_id,
object_id: self.object_id,
}
}
}
impl<'a> FocusParams<'a> { pub const METHOD: &'static str = "DOM.focus"; }
impl<'a> crate::CdpCommand<'a> for FocusParams<'a> {
const METHOD: &'static str = "DOM.focus";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetAttributesParams {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl GetAttributesParams {
pub fn builder(node_id: NodeId) -> GetAttributesParamsBuilder {
GetAttributesParamsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct GetAttributesParamsBuilder {
node_id: NodeId,
}
impl GetAttributesParamsBuilder {
pub fn build(self) -> GetAttributesParams {
GetAttributesParams {
node_id: self.node_id,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetAttributesReturns<'a> {
attributes: Vec<Cow<'a, str>>,
}
impl<'a> GetAttributesReturns<'a> {
pub fn builder(attributes: Vec<Cow<'a, str>>) -> GetAttributesReturnsBuilder<'a> {
GetAttributesReturnsBuilder {
attributes: attributes,
}
}
pub fn attributes(&self) -> &[Cow<'a, str>] { &self.attributes }
}
pub struct GetAttributesReturnsBuilder<'a> {
attributes: Vec<Cow<'a, str>>,
}
impl<'a> GetAttributesReturnsBuilder<'a> {
pub fn build(self) -> GetAttributesReturns<'a> {
GetAttributesReturns {
attributes: self.attributes,
}
}
}
impl GetAttributesParams { pub const METHOD: &'static str = "DOM.getAttributes"; }
impl<'a> crate::CdpCommand<'a> for GetAttributesParams {
const METHOD: &'static str = "DOM.getAttributes";
type Response = GetAttributesReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetBoxModelParams<'a> {
#[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
node_id: Option<NodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
backend_node_id: Option<BackendNodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
object_id: Option<crate::runtime::RemoteObjectId<'a>>,
}
impl<'a> GetBoxModelParams<'a> {
pub fn builder() -> GetBoxModelParamsBuilder<'a> {
GetBoxModelParamsBuilder {
node_id: None,
backend_node_id: None,
object_id: None,
}
}
pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
pub fn backend_node_id(&self) -> Option<&BackendNodeId> { self.backend_node_id.as_ref() }
pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
}
#[derive(Default)]
pub struct GetBoxModelParamsBuilder<'a> {
node_id: Option<NodeId>,
backend_node_id: Option<BackendNodeId>,
object_id: Option<crate::runtime::RemoteObjectId<'a>>,
}
impl<'a> GetBoxModelParamsBuilder<'a> {
pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
pub fn backend_node_id(mut self, backend_node_id: BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
pub fn build(self) -> GetBoxModelParams<'a> {
GetBoxModelParams {
node_id: self.node_id,
backend_node_id: self.backend_node_id,
object_id: self.object_id,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetBoxModelReturns {
model: BoxModel,
}
impl GetBoxModelReturns {
pub fn builder(model: BoxModel) -> GetBoxModelReturnsBuilder {
GetBoxModelReturnsBuilder {
model: model,
}
}
pub fn model(&self) -> &BoxModel { &self.model }
}
pub struct GetBoxModelReturnsBuilder {
model: BoxModel,
}
impl GetBoxModelReturnsBuilder {
pub fn build(self) -> GetBoxModelReturns {
GetBoxModelReturns {
model: self.model,
}
}
}
impl<'a> GetBoxModelParams<'a> { pub const METHOD: &'static str = "DOM.getBoxModel"; }
impl<'a> crate::CdpCommand<'a> for GetBoxModelParams<'a> {
const METHOD: &'static str = "DOM.getBoxModel";
type Response = GetBoxModelReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetContentQuadsParams<'a> {
#[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
node_id: Option<NodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
backend_node_id: Option<BackendNodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
object_id: Option<crate::runtime::RemoteObjectId<'a>>,
}
impl<'a> GetContentQuadsParams<'a> {
pub fn builder() -> GetContentQuadsParamsBuilder<'a> {
GetContentQuadsParamsBuilder {
node_id: None,
backend_node_id: None,
object_id: None,
}
}
pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
pub fn backend_node_id(&self) -> Option<&BackendNodeId> { self.backend_node_id.as_ref() }
pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
}
#[derive(Default)]
pub struct GetContentQuadsParamsBuilder<'a> {
node_id: Option<NodeId>,
backend_node_id: Option<BackendNodeId>,
object_id: Option<crate::runtime::RemoteObjectId<'a>>,
}
impl<'a> GetContentQuadsParamsBuilder<'a> {
pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
pub fn backend_node_id(mut self, backend_node_id: BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
pub fn build(self) -> GetContentQuadsParams<'a> {
GetContentQuadsParams {
node_id: self.node_id,
backend_node_id: self.backend_node_id,
object_id: self.object_id,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetContentQuadsReturns {
quads: Vec<Quad>,
}
impl GetContentQuadsReturns {
pub fn builder(quads: Vec<Quad>) -> GetContentQuadsReturnsBuilder {
GetContentQuadsReturnsBuilder {
quads: quads,
}
}
pub fn quads(&self) -> &[Quad] { &self.quads }
}
pub struct GetContentQuadsReturnsBuilder {
quads: Vec<Quad>,
}
impl GetContentQuadsReturnsBuilder {
pub fn build(self) -> GetContentQuadsReturns {
GetContentQuadsReturns {
quads: self.quads,
}
}
}
impl<'a> GetContentQuadsParams<'a> { pub const METHOD: &'static str = "DOM.getContentQuads"; }
impl<'a> crate::CdpCommand<'a> for GetContentQuadsParams<'a> {
const METHOD: &'static str = "DOM.getContentQuads";
type Response = GetContentQuadsReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetDocumentParams {
#[serde(skip_serializing_if = "Option::is_none")]
depth: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pierce: Option<bool>,
}
impl GetDocumentParams {
pub fn builder() -> GetDocumentParamsBuilder {
GetDocumentParamsBuilder {
depth: None,
pierce: None,
}
}
pub fn depth(&self) -> Option<i64> { self.depth }
pub fn pierce(&self) -> Option<bool> { self.pierce }
}
#[derive(Default)]
pub struct GetDocumentParamsBuilder {
depth: Option<i64>,
pierce: Option<bool>,
}
impl GetDocumentParamsBuilder {
pub fn depth(mut self, depth: i64) -> Self { self.depth = Some(depth); self }
pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
pub fn build(self) -> GetDocumentParams {
GetDocumentParams {
depth: self.depth,
pierce: self.pierce,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetDocumentReturns<'a> {
root: Node<'a>,
}
impl<'a> GetDocumentReturns<'a> {
pub fn builder(root: Node<'a>) -> GetDocumentReturnsBuilder<'a> {
GetDocumentReturnsBuilder {
root: root,
}
}
pub fn root(&self) -> &Node<'a> { &self.root }
}
pub struct GetDocumentReturnsBuilder<'a> {
root: Node<'a>,
}
impl<'a> GetDocumentReturnsBuilder<'a> {
pub fn build(self) -> GetDocumentReturns<'a> {
GetDocumentReturns {
root: self.root,
}
}
}
impl GetDocumentParams { pub const METHOD: &'static str = "DOM.getDocument"; }
impl<'a> crate::CdpCommand<'a> for GetDocumentParams {
const METHOD: &'static str = "DOM.getDocument";
type Response = GetDocumentReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetFlattenedDocumentParams {
#[serde(skip_serializing_if = "Option::is_none")]
depth: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pierce: Option<bool>,
}
impl GetFlattenedDocumentParams {
pub fn builder() -> GetFlattenedDocumentParamsBuilder {
GetFlattenedDocumentParamsBuilder {
depth: None,
pierce: None,
}
}
pub fn depth(&self) -> Option<i64> { self.depth }
pub fn pierce(&self) -> Option<bool> { self.pierce }
}
#[derive(Default)]
pub struct GetFlattenedDocumentParamsBuilder {
depth: Option<i64>,
pierce: Option<bool>,
}
impl GetFlattenedDocumentParamsBuilder {
pub fn depth(mut self, depth: i64) -> Self { self.depth = Some(depth); self }
pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
pub fn build(self) -> GetFlattenedDocumentParams {
GetFlattenedDocumentParams {
depth: self.depth,
pierce: self.pierce,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetFlattenedDocumentReturns<'a> {
nodes: Vec<Node<'a>>,
}
impl<'a> GetFlattenedDocumentReturns<'a> {
pub fn builder(nodes: Vec<Node<'a>>) -> GetFlattenedDocumentReturnsBuilder<'a> {
GetFlattenedDocumentReturnsBuilder {
nodes: nodes,
}
}
pub fn nodes(&self) -> &[Node<'a>] { &self.nodes }
}
pub struct GetFlattenedDocumentReturnsBuilder<'a> {
nodes: Vec<Node<'a>>,
}
impl<'a> GetFlattenedDocumentReturnsBuilder<'a> {
pub fn build(self) -> GetFlattenedDocumentReturns<'a> {
GetFlattenedDocumentReturns {
nodes: self.nodes,
}
}
}
impl GetFlattenedDocumentParams { pub const METHOD: &'static str = "DOM.getFlattenedDocument"; }
impl<'a> crate::CdpCommand<'a> for GetFlattenedDocumentParams {
const METHOD: &'static str = "DOM.getFlattenedDocument";
type Response = GetFlattenedDocumentReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetNodesForSubtreeByStyleParams<'a> {
#[serde(rename = "nodeId")]
node_id: NodeId,
#[serde(rename = "computedStyles")]
computed_styles: Vec<CSSComputedStyleProperty<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pierce: Option<bool>,
}
impl<'a> GetNodesForSubtreeByStyleParams<'a> {
pub fn builder(node_id: NodeId, computed_styles: Vec<CSSComputedStyleProperty<'a>>) -> GetNodesForSubtreeByStyleParamsBuilder<'a> {
GetNodesForSubtreeByStyleParamsBuilder {
node_id: node_id,
computed_styles: computed_styles,
pierce: None,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn computed_styles(&self) -> &[CSSComputedStyleProperty<'a>] { &self.computed_styles }
pub fn pierce(&self) -> Option<bool> { self.pierce }
}
pub struct GetNodesForSubtreeByStyleParamsBuilder<'a> {
node_id: NodeId,
computed_styles: Vec<CSSComputedStyleProperty<'a>>,
pierce: Option<bool>,
}
impl<'a> GetNodesForSubtreeByStyleParamsBuilder<'a> {
pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
pub fn build(self) -> GetNodesForSubtreeByStyleParams<'a> {
GetNodesForSubtreeByStyleParams {
node_id: self.node_id,
computed_styles: self.computed_styles,
pierce: self.pierce,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetNodesForSubtreeByStyleReturns {
#[serde(rename = "nodeIds")]
node_ids: Vec<NodeId>,
}
impl GetNodesForSubtreeByStyleReturns {
pub fn builder(node_ids: Vec<NodeId>) -> GetNodesForSubtreeByStyleReturnsBuilder {
GetNodesForSubtreeByStyleReturnsBuilder {
node_ids: node_ids,
}
}
pub fn node_ids(&self) -> &[NodeId] { &self.node_ids }
}
pub struct GetNodesForSubtreeByStyleReturnsBuilder {
node_ids: Vec<NodeId>,
}
impl GetNodesForSubtreeByStyleReturnsBuilder {
pub fn build(self) -> GetNodesForSubtreeByStyleReturns {
GetNodesForSubtreeByStyleReturns {
node_ids: self.node_ids,
}
}
}
impl<'a> GetNodesForSubtreeByStyleParams<'a> { pub const METHOD: &'static str = "DOM.getNodesForSubtreeByStyle"; }
impl<'a> crate::CdpCommand<'a> for GetNodesForSubtreeByStyleParams<'a> {
const METHOD: &'static str = "DOM.getNodesForSubtreeByStyle";
type Response = GetNodesForSubtreeByStyleReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetNodeForLocationParams {
x: i32,
y: i32,
#[serde(skip_serializing_if = "Option::is_none", rename = "includeUserAgentShadowDOM")]
include_user_agent_shadow_dom: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", rename = "ignorePointerEventsNone")]
ignore_pointer_events_none: Option<bool>,
}
impl GetNodeForLocationParams {
pub fn builder(x: i32, y: i32) -> GetNodeForLocationParamsBuilder {
GetNodeForLocationParamsBuilder {
x: x,
y: y,
include_user_agent_shadow_dom: None,
ignore_pointer_events_none: None,
}
}
pub fn x(&self) -> i32 { self.x }
pub fn y(&self) -> i32 { self.y }
pub fn include_user_agent_shadow_dom(&self) -> Option<bool> { self.include_user_agent_shadow_dom }
pub fn ignore_pointer_events_none(&self) -> Option<bool> { self.ignore_pointer_events_none }
}
pub struct GetNodeForLocationParamsBuilder {
x: i32,
y: i32,
include_user_agent_shadow_dom: Option<bool>,
ignore_pointer_events_none: Option<bool>,
}
impl GetNodeForLocationParamsBuilder {
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 }
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 }
pub fn build(self) -> GetNodeForLocationParams {
GetNodeForLocationParams {
x: self.x,
y: self.y,
include_user_agent_shadow_dom: self.include_user_agent_shadow_dom,
ignore_pointer_events_none: self.ignore_pointer_events_none,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetNodeForLocationReturns<'a> {
#[serde(rename = "backendNodeId")]
backend_node_id: BackendNodeId,
#[serde(rename = "frameId")]
frame_id: crate::page::FrameId<'a>,
#[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
node_id: Option<NodeId>,
}
impl<'a> GetNodeForLocationReturns<'a> {
pub fn builder(backend_node_id: BackendNodeId, frame_id: crate::page::FrameId<'a>) -> GetNodeForLocationReturnsBuilder<'a> {
GetNodeForLocationReturnsBuilder {
backend_node_id: backend_node_id,
frame_id: frame_id,
node_id: None,
}
}
pub fn backend_node_id(&self) -> &BackendNodeId { &self.backend_node_id }
pub fn frame_id(&self) -> &crate::page::FrameId<'a> { &self.frame_id }
pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
}
pub struct GetNodeForLocationReturnsBuilder<'a> {
backend_node_id: BackendNodeId,
frame_id: crate::page::FrameId<'a>,
node_id: Option<NodeId>,
}
impl<'a> GetNodeForLocationReturnsBuilder<'a> {
pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
pub fn build(self) -> GetNodeForLocationReturns<'a> {
GetNodeForLocationReturns {
backend_node_id: self.backend_node_id,
frame_id: self.frame_id,
node_id: self.node_id,
}
}
}
impl GetNodeForLocationParams { pub const METHOD: &'static str = "DOM.getNodeForLocation"; }
impl<'a> crate::CdpCommand<'a> for GetNodeForLocationParams {
const METHOD: &'static str = "DOM.getNodeForLocation";
type Response = GetNodeForLocationReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetOuterHTMLParams<'a> {
#[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
node_id: Option<NodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
backend_node_id: Option<BackendNodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
object_id: Option<crate::runtime::RemoteObjectId<'a>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "includeShadowDOM")]
include_shadow_dom: Option<bool>,
}
impl<'a> GetOuterHTMLParams<'a> {
pub fn builder() -> GetOuterHTMLParamsBuilder<'a> {
GetOuterHTMLParamsBuilder {
node_id: None,
backend_node_id: None,
object_id: None,
include_shadow_dom: None,
}
}
pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
pub fn backend_node_id(&self) -> Option<&BackendNodeId> { self.backend_node_id.as_ref() }
pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
pub fn include_shadow_dom(&self) -> Option<bool> { self.include_shadow_dom }
}
#[derive(Default)]
pub struct GetOuterHTMLParamsBuilder<'a> {
node_id: Option<NodeId>,
backend_node_id: Option<BackendNodeId>,
object_id: Option<crate::runtime::RemoteObjectId<'a>>,
include_shadow_dom: Option<bool>,
}
impl<'a> GetOuterHTMLParamsBuilder<'a> {
pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
pub fn backend_node_id(mut self, backend_node_id: BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
pub fn include_shadow_dom(mut self, include_shadow_dom: bool) -> Self { self.include_shadow_dom = Some(include_shadow_dom); self }
pub fn build(self) -> GetOuterHTMLParams<'a> {
GetOuterHTMLParams {
node_id: self.node_id,
backend_node_id: self.backend_node_id,
object_id: self.object_id,
include_shadow_dom: self.include_shadow_dom,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetOuterHTMLReturns<'a> {
#[serde(rename = "outerHTML")]
outer_html: Cow<'a, str>,
}
impl<'a> GetOuterHTMLReturns<'a> {
pub fn builder(outer_html: impl Into<Cow<'a, str>>) -> GetOuterHTMLReturnsBuilder<'a> {
GetOuterHTMLReturnsBuilder {
outer_html: outer_html.into(),
}
}
pub fn outer_html(&self) -> &str { self.outer_html.as_ref() }
}
pub struct GetOuterHTMLReturnsBuilder<'a> {
outer_html: Cow<'a, str>,
}
impl<'a> GetOuterHTMLReturnsBuilder<'a> {
pub fn build(self) -> GetOuterHTMLReturns<'a> {
GetOuterHTMLReturns {
outer_html: self.outer_html,
}
}
}
impl<'a> GetOuterHTMLParams<'a> { pub const METHOD: &'static str = "DOM.getOuterHTML"; }
impl<'a> crate::CdpCommand<'a> for GetOuterHTMLParams<'a> {
const METHOD: &'static str = "DOM.getOuterHTML";
type Response = GetOuterHTMLReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetRelayoutBoundaryParams {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl GetRelayoutBoundaryParams {
pub fn builder(node_id: NodeId) -> GetRelayoutBoundaryParamsBuilder {
GetRelayoutBoundaryParamsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct GetRelayoutBoundaryParamsBuilder {
node_id: NodeId,
}
impl GetRelayoutBoundaryParamsBuilder {
pub fn build(self) -> GetRelayoutBoundaryParams {
GetRelayoutBoundaryParams {
node_id: self.node_id,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetRelayoutBoundaryReturns {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl GetRelayoutBoundaryReturns {
pub fn builder(node_id: NodeId) -> GetRelayoutBoundaryReturnsBuilder {
GetRelayoutBoundaryReturnsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct GetRelayoutBoundaryReturnsBuilder {
node_id: NodeId,
}
impl GetRelayoutBoundaryReturnsBuilder {
pub fn build(self) -> GetRelayoutBoundaryReturns {
GetRelayoutBoundaryReturns {
node_id: self.node_id,
}
}
}
impl GetRelayoutBoundaryParams { pub const METHOD: &'static str = "DOM.getRelayoutBoundary"; }
impl<'a> crate::CdpCommand<'a> for GetRelayoutBoundaryParams {
const METHOD: &'static str = "DOM.getRelayoutBoundary";
type Response = GetRelayoutBoundaryReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetSearchResultsParams<'a> {
#[serde(rename = "searchId")]
search_id: Cow<'a, str>,
#[serde(rename = "fromIndex")]
from_index: u64,
#[serde(rename = "toIndex")]
to_index: u64,
}
impl<'a> GetSearchResultsParams<'a> {
pub fn builder(search_id: impl Into<Cow<'a, str>>, from_index: u64, to_index: u64) -> GetSearchResultsParamsBuilder<'a> {
GetSearchResultsParamsBuilder {
search_id: search_id.into(),
from_index: from_index,
to_index: to_index,
}
}
pub fn search_id(&self) -> &str { self.search_id.as_ref() }
pub fn from_index(&self) -> u64 { self.from_index }
pub fn to_index(&self) -> u64 { self.to_index }
}
pub struct GetSearchResultsParamsBuilder<'a> {
search_id: Cow<'a, str>,
from_index: u64,
to_index: u64,
}
impl<'a> GetSearchResultsParamsBuilder<'a> {
pub fn build(self) -> GetSearchResultsParams<'a> {
GetSearchResultsParams {
search_id: self.search_id,
from_index: self.from_index,
to_index: self.to_index,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetSearchResultsReturns {
#[serde(rename = "nodeIds")]
node_ids: Vec<NodeId>,
}
impl GetSearchResultsReturns {
pub fn builder(node_ids: Vec<NodeId>) -> GetSearchResultsReturnsBuilder {
GetSearchResultsReturnsBuilder {
node_ids: node_ids,
}
}
pub fn node_ids(&self) -> &[NodeId] { &self.node_ids }
}
pub struct GetSearchResultsReturnsBuilder {
node_ids: Vec<NodeId>,
}
impl GetSearchResultsReturnsBuilder {
pub fn build(self) -> GetSearchResultsReturns {
GetSearchResultsReturns {
node_ids: self.node_ids,
}
}
}
impl<'a> GetSearchResultsParams<'a> { pub const METHOD: &'static str = "DOM.getSearchResults"; }
impl<'a> crate::CdpCommand<'a> for GetSearchResultsParams<'a> {
const METHOD: &'static str = "DOM.getSearchResults";
type Response = GetSearchResultsReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct HideHighlightParams {}
impl HideHighlightParams { pub const METHOD: &'static str = "DOM.hideHighlight"; }
impl<'a> crate::CdpCommand<'a> for HideHighlightParams {
const METHOD: &'static str = "DOM.hideHighlight";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct HighlightNodeParams {}
impl HighlightNodeParams { pub const METHOD: &'static str = "DOM.highlightNode"; }
impl<'a> crate::CdpCommand<'a> for HighlightNodeParams {
const METHOD: &'static str = "DOM.highlightNode";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct HighlightRectParams {}
impl HighlightRectParams { pub const METHOD: &'static str = "DOM.highlightRect"; }
impl<'a> crate::CdpCommand<'a> for HighlightRectParams {
const METHOD: &'static str = "DOM.highlightRect";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct MarkUndoableStateParams {}
impl MarkUndoableStateParams { pub const METHOD: &'static str = "DOM.markUndoableState"; }
impl<'a> crate::CdpCommand<'a> for MarkUndoableStateParams {
const METHOD: &'static str = "DOM.markUndoableState";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct MoveToParams {
#[serde(rename = "nodeId")]
node_id: NodeId,
#[serde(rename = "targetNodeId")]
target_node_id: NodeId,
#[serde(skip_serializing_if = "Option::is_none", rename = "insertBeforeNodeId")]
insert_before_node_id: Option<NodeId>,
}
impl MoveToParams {
pub fn builder(node_id: NodeId, target_node_id: NodeId) -> MoveToParamsBuilder {
MoveToParamsBuilder {
node_id: node_id,
target_node_id: target_node_id,
insert_before_node_id: None,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn target_node_id(&self) -> &NodeId { &self.target_node_id }
pub fn insert_before_node_id(&self) -> Option<&NodeId> { self.insert_before_node_id.as_ref() }
}
pub struct MoveToParamsBuilder {
node_id: NodeId,
target_node_id: NodeId,
insert_before_node_id: Option<NodeId>,
}
impl MoveToParamsBuilder {
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 }
pub fn build(self) -> MoveToParams {
MoveToParams {
node_id: self.node_id,
target_node_id: self.target_node_id,
insert_before_node_id: self.insert_before_node_id,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct MoveToReturns {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl MoveToReturns {
pub fn builder(node_id: NodeId) -> MoveToReturnsBuilder {
MoveToReturnsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct MoveToReturnsBuilder {
node_id: NodeId,
}
impl MoveToReturnsBuilder {
pub fn build(self) -> MoveToReturns {
MoveToReturns {
node_id: self.node_id,
}
}
}
impl MoveToParams { pub const METHOD: &'static str = "DOM.moveTo"; }
impl<'a> crate::CdpCommand<'a> for MoveToParams {
const METHOD: &'static str = "DOM.moveTo";
type Response = MoveToReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct PerformSearchParams<'a> {
query: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none", rename = "includeUserAgentShadowDOM")]
include_user_agent_shadow_dom: Option<bool>,
}
impl<'a> PerformSearchParams<'a> {
pub fn builder(query: impl Into<Cow<'a, str>>) -> PerformSearchParamsBuilder<'a> {
PerformSearchParamsBuilder {
query: query.into(),
include_user_agent_shadow_dom: None,
}
}
pub fn query(&self) -> &str { self.query.as_ref() }
pub fn include_user_agent_shadow_dom(&self) -> Option<bool> { self.include_user_agent_shadow_dom }
}
pub struct PerformSearchParamsBuilder<'a> {
query: Cow<'a, str>,
include_user_agent_shadow_dom: Option<bool>,
}
impl<'a> PerformSearchParamsBuilder<'a> {
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 }
pub fn build(self) -> PerformSearchParams<'a> {
PerformSearchParams {
query: self.query,
include_user_agent_shadow_dom: self.include_user_agent_shadow_dom,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct PerformSearchReturns<'a> {
#[serde(rename = "searchId")]
search_id: Cow<'a, str>,
#[serde(rename = "resultCount")]
result_count: u64,
}
impl<'a> PerformSearchReturns<'a> {
pub fn builder(search_id: impl Into<Cow<'a, str>>, result_count: u64) -> PerformSearchReturnsBuilder<'a> {
PerformSearchReturnsBuilder {
search_id: search_id.into(),
result_count: result_count,
}
}
pub fn search_id(&self) -> &str { self.search_id.as_ref() }
pub fn result_count(&self) -> u64 { self.result_count }
}
pub struct PerformSearchReturnsBuilder<'a> {
search_id: Cow<'a, str>,
result_count: u64,
}
impl<'a> PerformSearchReturnsBuilder<'a> {
pub fn build(self) -> PerformSearchReturns<'a> {
PerformSearchReturns {
search_id: self.search_id,
result_count: self.result_count,
}
}
}
impl<'a> PerformSearchParams<'a> { pub const METHOD: &'static str = "DOM.performSearch"; }
impl<'a> crate::CdpCommand<'a> for PerformSearchParams<'a> {
const METHOD: &'static str = "DOM.performSearch";
type Response = PerformSearchReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct PushNodeByPathToFrontendParams<'a> {
path: Cow<'a, str>,
}
impl<'a> PushNodeByPathToFrontendParams<'a> {
pub fn builder(path: impl Into<Cow<'a, str>>) -> PushNodeByPathToFrontendParamsBuilder<'a> {
PushNodeByPathToFrontendParamsBuilder {
path: path.into(),
}
}
pub fn path(&self) -> &str { self.path.as_ref() }
}
pub struct PushNodeByPathToFrontendParamsBuilder<'a> {
path: Cow<'a, str>,
}
impl<'a> PushNodeByPathToFrontendParamsBuilder<'a> {
pub fn build(self) -> PushNodeByPathToFrontendParams<'a> {
PushNodeByPathToFrontendParams {
path: self.path,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct PushNodeByPathToFrontendReturns {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl PushNodeByPathToFrontendReturns {
pub fn builder(node_id: NodeId) -> PushNodeByPathToFrontendReturnsBuilder {
PushNodeByPathToFrontendReturnsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct PushNodeByPathToFrontendReturnsBuilder {
node_id: NodeId,
}
impl PushNodeByPathToFrontendReturnsBuilder {
pub fn build(self) -> PushNodeByPathToFrontendReturns {
PushNodeByPathToFrontendReturns {
node_id: self.node_id,
}
}
}
impl<'a> PushNodeByPathToFrontendParams<'a> { pub const METHOD: &'static str = "DOM.pushNodeByPathToFrontend"; }
impl<'a> crate::CdpCommand<'a> for PushNodeByPathToFrontendParams<'a> {
const METHOD: &'static str = "DOM.pushNodeByPathToFrontend";
type Response = PushNodeByPathToFrontendReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct PushNodesByBackendIdsToFrontendParams {
#[serde(rename = "backendNodeIds")]
backend_node_ids: Vec<BackendNodeId>,
}
impl PushNodesByBackendIdsToFrontendParams {
pub fn builder(backend_node_ids: Vec<BackendNodeId>) -> PushNodesByBackendIdsToFrontendParamsBuilder {
PushNodesByBackendIdsToFrontendParamsBuilder {
backend_node_ids: backend_node_ids,
}
}
pub fn backend_node_ids(&self) -> &[BackendNodeId] { &self.backend_node_ids }
}
pub struct PushNodesByBackendIdsToFrontendParamsBuilder {
backend_node_ids: Vec<BackendNodeId>,
}
impl PushNodesByBackendIdsToFrontendParamsBuilder {
pub fn build(self) -> PushNodesByBackendIdsToFrontendParams {
PushNodesByBackendIdsToFrontendParams {
backend_node_ids: self.backend_node_ids,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct PushNodesByBackendIdsToFrontendReturns {
#[serde(rename = "nodeIds")]
node_ids: Vec<NodeId>,
}
impl PushNodesByBackendIdsToFrontendReturns {
pub fn builder(node_ids: Vec<NodeId>) -> PushNodesByBackendIdsToFrontendReturnsBuilder {
PushNodesByBackendIdsToFrontendReturnsBuilder {
node_ids: node_ids,
}
}
pub fn node_ids(&self) -> &[NodeId] { &self.node_ids }
}
pub struct PushNodesByBackendIdsToFrontendReturnsBuilder {
node_ids: Vec<NodeId>,
}
impl PushNodesByBackendIdsToFrontendReturnsBuilder {
pub fn build(self) -> PushNodesByBackendIdsToFrontendReturns {
PushNodesByBackendIdsToFrontendReturns {
node_ids: self.node_ids,
}
}
}
impl PushNodesByBackendIdsToFrontendParams { pub const METHOD: &'static str = "DOM.pushNodesByBackendIdsToFrontend"; }
impl<'a> crate::CdpCommand<'a> for PushNodesByBackendIdsToFrontendParams {
const METHOD: &'static str = "DOM.pushNodesByBackendIdsToFrontend";
type Response = PushNodesByBackendIdsToFrontendReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct QuerySelectorParams<'a> {
#[serde(rename = "nodeId")]
node_id: NodeId,
selector: Cow<'a, str>,
}
impl<'a> QuerySelectorParams<'a> {
pub fn builder(node_id: NodeId, selector: impl Into<Cow<'a, str>>) -> QuerySelectorParamsBuilder<'a> {
QuerySelectorParamsBuilder {
node_id: node_id,
selector: selector.into(),
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn selector(&self) -> &str { self.selector.as_ref() }
}
pub struct QuerySelectorParamsBuilder<'a> {
node_id: NodeId,
selector: Cow<'a, str>,
}
impl<'a> QuerySelectorParamsBuilder<'a> {
pub fn build(self) -> QuerySelectorParams<'a> {
QuerySelectorParams {
node_id: self.node_id,
selector: self.selector,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct QuerySelectorReturns {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl QuerySelectorReturns {
pub fn builder(node_id: NodeId) -> QuerySelectorReturnsBuilder {
QuerySelectorReturnsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct QuerySelectorReturnsBuilder {
node_id: NodeId,
}
impl QuerySelectorReturnsBuilder {
pub fn build(self) -> QuerySelectorReturns {
QuerySelectorReturns {
node_id: self.node_id,
}
}
}
impl<'a> QuerySelectorParams<'a> { pub const METHOD: &'static str = "DOM.querySelector"; }
impl<'a> crate::CdpCommand<'a> for QuerySelectorParams<'a> {
const METHOD: &'static str = "DOM.querySelector";
type Response = QuerySelectorReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct QuerySelectorAllParams<'a> {
#[serde(rename = "nodeId")]
node_id: NodeId,
selector: Cow<'a, str>,
}
impl<'a> QuerySelectorAllParams<'a> {
pub fn builder(node_id: NodeId, selector: impl Into<Cow<'a, str>>) -> QuerySelectorAllParamsBuilder<'a> {
QuerySelectorAllParamsBuilder {
node_id: node_id,
selector: selector.into(),
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn selector(&self) -> &str { self.selector.as_ref() }
}
pub struct QuerySelectorAllParamsBuilder<'a> {
node_id: NodeId,
selector: Cow<'a, str>,
}
impl<'a> QuerySelectorAllParamsBuilder<'a> {
pub fn build(self) -> QuerySelectorAllParams<'a> {
QuerySelectorAllParams {
node_id: self.node_id,
selector: self.selector,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct QuerySelectorAllReturns {
#[serde(rename = "nodeIds")]
node_ids: Vec<NodeId>,
}
impl QuerySelectorAllReturns {
pub fn builder(node_ids: Vec<NodeId>) -> QuerySelectorAllReturnsBuilder {
QuerySelectorAllReturnsBuilder {
node_ids: node_ids,
}
}
pub fn node_ids(&self) -> &[NodeId] { &self.node_ids }
}
pub struct QuerySelectorAllReturnsBuilder {
node_ids: Vec<NodeId>,
}
impl QuerySelectorAllReturnsBuilder {
pub fn build(self) -> QuerySelectorAllReturns {
QuerySelectorAllReturns {
node_ids: self.node_ids,
}
}
}
impl<'a> QuerySelectorAllParams<'a> { pub const METHOD: &'static str = "DOM.querySelectorAll"; }
impl<'a> crate::CdpCommand<'a> for QuerySelectorAllParams<'a> {
const METHOD: &'static str = "DOM.querySelectorAll";
type Response = QuerySelectorAllReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetTopLayerElementsReturns {
#[serde(rename = "nodeIds")]
node_ids: Vec<NodeId>,
}
impl GetTopLayerElementsReturns {
pub fn builder(node_ids: Vec<NodeId>) -> GetTopLayerElementsReturnsBuilder {
GetTopLayerElementsReturnsBuilder {
node_ids: node_ids,
}
}
pub fn node_ids(&self) -> &[NodeId] { &self.node_ids }
}
pub struct GetTopLayerElementsReturnsBuilder {
node_ids: Vec<NodeId>,
}
impl GetTopLayerElementsReturnsBuilder {
pub fn build(self) -> GetTopLayerElementsReturns {
GetTopLayerElementsReturns {
node_ids: self.node_ids,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct GetTopLayerElementsParams {}
impl GetTopLayerElementsParams { pub const METHOD: &'static str = "DOM.getTopLayerElements"; }
impl<'a> crate::CdpCommand<'a> for GetTopLayerElementsParams {
const METHOD: &'static str = "DOM.getTopLayerElements";
type Response = GetTopLayerElementsReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetElementByRelationParams<'a> {
#[serde(rename = "nodeId")]
node_id: NodeId,
relation: Cow<'a, str>,
}
impl<'a> GetElementByRelationParams<'a> {
pub fn builder(node_id: NodeId, relation: impl Into<Cow<'a, str>>) -> GetElementByRelationParamsBuilder<'a> {
GetElementByRelationParamsBuilder {
node_id: node_id,
relation: relation.into(),
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn relation(&self) -> &str { self.relation.as_ref() }
}
pub struct GetElementByRelationParamsBuilder<'a> {
node_id: NodeId,
relation: Cow<'a, str>,
}
impl<'a> GetElementByRelationParamsBuilder<'a> {
pub fn build(self) -> GetElementByRelationParams<'a> {
GetElementByRelationParams {
node_id: self.node_id,
relation: self.relation,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetElementByRelationReturns {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl GetElementByRelationReturns {
pub fn builder(node_id: NodeId) -> GetElementByRelationReturnsBuilder {
GetElementByRelationReturnsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct GetElementByRelationReturnsBuilder {
node_id: NodeId,
}
impl GetElementByRelationReturnsBuilder {
pub fn build(self) -> GetElementByRelationReturns {
GetElementByRelationReturns {
node_id: self.node_id,
}
}
}
impl<'a> GetElementByRelationParams<'a> { pub const METHOD: &'static str = "DOM.getElementByRelation"; }
impl<'a> crate::CdpCommand<'a> for GetElementByRelationParams<'a> {
const METHOD: &'static str = "DOM.getElementByRelation";
type Response = GetElementByRelationReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct RedoParams {}
impl RedoParams { pub const METHOD: &'static str = "DOM.redo"; }
impl<'a> crate::CdpCommand<'a> for RedoParams {
const METHOD: &'static str = "DOM.redo";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RemoveAttributeParams<'a> {
#[serde(rename = "nodeId")]
node_id: NodeId,
name: Cow<'a, str>,
}
impl<'a> RemoveAttributeParams<'a> {
pub fn builder(node_id: NodeId, name: impl Into<Cow<'a, str>>) -> RemoveAttributeParamsBuilder<'a> {
RemoveAttributeParamsBuilder {
node_id: node_id,
name: name.into(),
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn name(&self) -> &str { self.name.as_ref() }
}
pub struct RemoveAttributeParamsBuilder<'a> {
node_id: NodeId,
name: Cow<'a, str>,
}
impl<'a> RemoveAttributeParamsBuilder<'a> {
pub fn build(self) -> RemoveAttributeParams<'a> {
RemoveAttributeParams {
node_id: self.node_id,
name: self.name,
}
}
}
impl<'a> RemoveAttributeParams<'a> { pub const METHOD: &'static str = "DOM.removeAttribute"; }
impl<'a> crate::CdpCommand<'a> for RemoveAttributeParams<'a> {
const METHOD: &'static str = "DOM.removeAttribute";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RemoveNodeParams {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl RemoveNodeParams {
pub fn builder(node_id: NodeId) -> RemoveNodeParamsBuilder {
RemoveNodeParamsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct RemoveNodeParamsBuilder {
node_id: NodeId,
}
impl RemoveNodeParamsBuilder {
pub fn build(self) -> RemoveNodeParams {
RemoveNodeParams {
node_id: self.node_id,
}
}
}
impl RemoveNodeParams { pub const METHOD: &'static str = "DOM.removeNode"; }
impl<'a> crate::CdpCommand<'a> for RemoveNodeParams {
const METHOD: &'static str = "DOM.removeNode";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RequestChildNodesParams {
#[serde(rename = "nodeId")]
node_id: NodeId,
#[serde(skip_serializing_if = "Option::is_none")]
depth: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pierce: Option<bool>,
}
impl RequestChildNodesParams {
pub fn builder(node_id: NodeId) -> RequestChildNodesParamsBuilder {
RequestChildNodesParamsBuilder {
node_id: node_id,
depth: None,
pierce: None,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn depth(&self) -> Option<i64> { self.depth }
pub fn pierce(&self) -> Option<bool> { self.pierce }
}
pub struct RequestChildNodesParamsBuilder {
node_id: NodeId,
depth: Option<i64>,
pierce: Option<bool>,
}
impl RequestChildNodesParamsBuilder {
pub fn depth(mut self, depth: i64) -> Self { self.depth = Some(depth); self }
pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
pub fn build(self) -> RequestChildNodesParams {
RequestChildNodesParams {
node_id: self.node_id,
depth: self.depth,
pierce: self.pierce,
}
}
}
impl RequestChildNodesParams { pub const METHOD: &'static str = "DOM.requestChildNodes"; }
impl<'a> crate::CdpCommand<'a> for RequestChildNodesParams {
const METHOD: &'static str = "DOM.requestChildNodes";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RequestNodeParams<'a> {
#[serde(rename = "objectId")]
object_id: crate::runtime::RemoteObjectId<'a>,
}
impl<'a> RequestNodeParams<'a> {
pub fn builder(object_id: crate::runtime::RemoteObjectId<'a>) -> RequestNodeParamsBuilder<'a> {
RequestNodeParamsBuilder {
object_id: object_id,
}
}
pub fn object_id(&self) -> &crate::runtime::RemoteObjectId<'a> { &self.object_id }
}
pub struct RequestNodeParamsBuilder<'a> {
object_id: crate::runtime::RemoteObjectId<'a>,
}
impl<'a> RequestNodeParamsBuilder<'a> {
pub fn build(self) -> RequestNodeParams<'a> {
RequestNodeParams {
object_id: self.object_id,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RequestNodeReturns {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl RequestNodeReturns {
pub fn builder(node_id: NodeId) -> RequestNodeReturnsBuilder {
RequestNodeReturnsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct RequestNodeReturnsBuilder {
node_id: NodeId,
}
impl RequestNodeReturnsBuilder {
pub fn build(self) -> RequestNodeReturns {
RequestNodeReturns {
node_id: self.node_id,
}
}
}
impl<'a> RequestNodeParams<'a> { pub const METHOD: &'static str = "DOM.requestNode"; }
impl<'a> crate::CdpCommand<'a> for RequestNodeParams<'a> {
const METHOD: &'static str = "DOM.requestNode";
type Response = RequestNodeReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ResolveNodeParams<'a> {
#[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
node_id: Option<NodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
backend_node_id: Option<crate::dom::BackendNodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "objectGroup")]
object_group: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "executionContextId")]
execution_context_id: Option<crate::runtime::ExecutionContextId>,
}
impl<'a> ResolveNodeParams<'a> {
pub fn builder() -> ResolveNodeParamsBuilder<'a> {
ResolveNodeParamsBuilder {
node_id: None,
backend_node_id: None,
object_group: None,
execution_context_id: None,
}
}
pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
pub fn backend_node_id(&self) -> Option<&crate::dom::BackendNodeId> { self.backend_node_id.as_ref() }
pub fn object_group(&self) -> Option<&str> { self.object_group.as_deref() }
pub fn execution_context_id(&self) -> Option<&crate::runtime::ExecutionContextId> { self.execution_context_id.as_ref() }
}
#[derive(Default)]
pub struct ResolveNodeParamsBuilder<'a> {
node_id: Option<NodeId>,
backend_node_id: Option<crate::dom::BackendNodeId>,
object_group: Option<Cow<'a, str>>,
execution_context_id: Option<crate::runtime::ExecutionContextId>,
}
impl<'a> ResolveNodeParamsBuilder<'a> {
pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
pub fn backend_node_id(mut self, backend_node_id: crate::dom::BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
pub fn object_group(mut self, object_group: impl Into<Cow<'a, str>>) -> Self { self.object_group = Some(object_group.into()); self }
pub fn execution_context_id(mut self, execution_context_id: crate::runtime::ExecutionContextId) -> Self { self.execution_context_id = Some(execution_context_id); self }
pub fn build(self) -> ResolveNodeParams<'a> {
ResolveNodeParams {
node_id: self.node_id,
backend_node_id: self.backend_node_id,
object_group: self.object_group,
execution_context_id: self.execution_context_id,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ResolveNodeReturns {
object: crate::runtime::RemoteObject,
}
impl ResolveNodeReturns {
pub fn builder(object: crate::runtime::RemoteObject) -> ResolveNodeReturnsBuilder {
ResolveNodeReturnsBuilder {
object: object,
}
}
pub fn object(&self) -> &crate::runtime::RemoteObject { &self.object }
}
pub struct ResolveNodeReturnsBuilder {
object: crate::runtime::RemoteObject,
}
impl ResolveNodeReturnsBuilder {
pub fn build(self) -> ResolveNodeReturns {
ResolveNodeReturns {
object: self.object,
}
}
}
impl<'a> ResolveNodeParams<'a> { pub const METHOD: &'static str = "DOM.resolveNode"; }
impl<'a> crate::CdpCommand<'a> for ResolveNodeParams<'a> {
const METHOD: &'static str = "DOM.resolveNode";
type Response = ResolveNodeReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetAttributeValueParams<'a> {
#[serde(rename = "nodeId")]
node_id: NodeId,
name: Cow<'a, str>,
value: Cow<'a, str>,
}
impl<'a> SetAttributeValueParams<'a> {
pub fn builder(node_id: NodeId, name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> SetAttributeValueParamsBuilder<'a> {
SetAttributeValueParamsBuilder {
node_id: node_id,
name: name.into(),
value: value.into(),
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn name(&self) -> &str { self.name.as_ref() }
pub fn value(&self) -> &str { self.value.as_ref() }
}
pub struct SetAttributeValueParamsBuilder<'a> {
node_id: NodeId,
name: Cow<'a, str>,
value: Cow<'a, str>,
}
impl<'a> SetAttributeValueParamsBuilder<'a> {
pub fn build(self) -> SetAttributeValueParams<'a> {
SetAttributeValueParams {
node_id: self.node_id,
name: self.name,
value: self.value,
}
}
}
impl<'a> SetAttributeValueParams<'a> { pub const METHOD: &'static str = "DOM.setAttributeValue"; }
impl<'a> crate::CdpCommand<'a> for SetAttributeValueParams<'a> {
const METHOD: &'static str = "DOM.setAttributeValue";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetAttributesAsTextParams<'a> {
#[serde(rename = "nodeId")]
node_id: NodeId,
text: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
name: Option<Cow<'a, str>>,
}
impl<'a> SetAttributesAsTextParams<'a> {
pub fn builder(node_id: NodeId, text: impl Into<Cow<'a, str>>) -> SetAttributesAsTextParamsBuilder<'a> {
SetAttributesAsTextParamsBuilder {
node_id: node_id,
text: text.into(),
name: None,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn text(&self) -> &str { self.text.as_ref() }
pub fn name(&self) -> Option<&str> { self.name.as_deref() }
}
pub struct SetAttributesAsTextParamsBuilder<'a> {
node_id: NodeId,
text: Cow<'a, str>,
name: Option<Cow<'a, str>>,
}
impl<'a> SetAttributesAsTextParamsBuilder<'a> {
pub fn name(mut self, name: impl Into<Cow<'a, str>>) -> Self { self.name = Some(name.into()); self }
pub fn build(self) -> SetAttributesAsTextParams<'a> {
SetAttributesAsTextParams {
node_id: self.node_id,
text: self.text,
name: self.name,
}
}
}
impl<'a> SetAttributesAsTextParams<'a> { pub const METHOD: &'static str = "DOM.setAttributesAsText"; }
impl<'a> crate::CdpCommand<'a> for SetAttributesAsTextParams<'a> {
const METHOD: &'static str = "DOM.setAttributesAsText";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetFileInputFilesParams<'a> {
files: Vec<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
node_id: Option<NodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
backend_node_id: Option<BackendNodeId>,
#[serde(skip_serializing_if = "Option::is_none", rename = "objectId")]
object_id: Option<crate::runtime::RemoteObjectId<'a>>,
}
impl<'a> SetFileInputFilesParams<'a> {
pub fn builder(files: Vec<Cow<'a, str>>) -> SetFileInputFilesParamsBuilder<'a> {
SetFileInputFilesParamsBuilder {
files: files,
node_id: None,
backend_node_id: None,
object_id: None,
}
}
pub fn files(&self) -> &[Cow<'a, str>] { &self.files }
pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
pub fn backend_node_id(&self) -> Option<&BackendNodeId> { self.backend_node_id.as_ref() }
pub fn object_id(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.object_id.as_ref() }
}
pub struct SetFileInputFilesParamsBuilder<'a> {
files: Vec<Cow<'a, str>>,
node_id: Option<NodeId>,
backend_node_id: Option<BackendNodeId>,
object_id: Option<crate::runtime::RemoteObjectId<'a>>,
}
impl<'a> SetFileInputFilesParamsBuilder<'a> {
pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
pub fn backend_node_id(mut self, backend_node_id: BackendNodeId) -> Self { self.backend_node_id = Some(backend_node_id); self }
pub fn object_id(mut self, object_id: crate::runtime::RemoteObjectId<'a>) -> Self { self.object_id = Some(object_id); self }
pub fn build(self) -> SetFileInputFilesParams<'a> {
SetFileInputFilesParams {
files: self.files,
node_id: self.node_id,
backend_node_id: self.backend_node_id,
object_id: self.object_id,
}
}
}
impl<'a> SetFileInputFilesParams<'a> { pub const METHOD: &'static str = "DOM.setFileInputFiles"; }
impl<'a> crate::CdpCommand<'a> for SetFileInputFilesParams<'a> {
const METHOD: &'static str = "DOM.setFileInputFiles";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetNodeStackTracesEnabledParams {
enable: bool,
}
impl SetNodeStackTracesEnabledParams {
pub fn builder(enable: bool) -> SetNodeStackTracesEnabledParamsBuilder {
SetNodeStackTracesEnabledParamsBuilder {
enable: enable,
}
}
pub fn enable(&self) -> bool { self.enable }
}
pub struct SetNodeStackTracesEnabledParamsBuilder {
enable: bool,
}
impl SetNodeStackTracesEnabledParamsBuilder {
pub fn build(self) -> SetNodeStackTracesEnabledParams {
SetNodeStackTracesEnabledParams {
enable: self.enable,
}
}
}
impl SetNodeStackTracesEnabledParams { pub const METHOD: &'static str = "DOM.setNodeStackTracesEnabled"; }
impl<'a> crate::CdpCommand<'a> for SetNodeStackTracesEnabledParams {
const METHOD: &'static str = "DOM.setNodeStackTracesEnabled";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetNodeStackTracesParams {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl GetNodeStackTracesParams {
pub fn builder(node_id: NodeId) -> GetNodeStackTracesParamsBuilder {
GetNodeStackTracesParamsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct GetNodeStackTracesParamsBuilder {
node_id: NodeId,
}
impl GetNodeStackTracesParamsBuilder {
pub fn build(self) -> GetNodeStackTracesParams {
GetNodeStackTracesParams {
node_id: self.node_id,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetNodeStackTracesReturns {
#[serde(skip_serializing_if = "Option::is_none")]
creation: Option<crate::runtime::StackTrace>,
}
impl GetNodeStackTracesReturns {
pub fn builder() -> GetNodeStackTracesReturnsBuilder {
GetNodeStackTracesReturnsBuilder {
creation: None,
}
}
pub fn creation(&self) -> Option<&crate::runtime::StackTrace> { self.creation.as_ref() }
}
#[derive(Default)]
pub struct GetNodeStackTracesReturnsBuilder {
creation: Option<crate::runtime::StackTrace>,
}
impl GetNodeStackTracesReturnsBuilder {
pub fn creation(mut self, creation: crate::runtime::StackTrace) -> Self { self.creation = Some(creation); self }
pub fn build(self) -> GetNodeStackTracesReturns {
GetNodeStackTracesReturns {
creation: self.creation,
}
}
}
impl GetNodeStackTracesParams { pub const METHOD: &'static str = "DOM.getNodeStackTraces"; }
impl<'a> crate::CdpCommand<'a> for GetNodeStackTracesParams {
const METHOD: &'static str = "DOM.getNodeStackTraces";
type Response = GetNodeStackTracesReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetFileInfoParams<'a> {
#[serde(rename = "objectId")]
object_id: crate::runtime::RemoteObjectId<'a>,
}
impl<'a> GetFileInfoParams<'a> {
pub fn builder(object_id: crate::runtime::RemoteObjectId<'a>) -> GetFileInfoParamsBuilder<'a> {
GetFileInfoParamsBuilder {
object_id: object_id,
}
}
pub fn object_id(&self) -> &crate::runtime::RemoteObjectId<'a> { &self.object_id }
}
pub struct GetFileInfoParamsBuilder<'a> {
object_id: crate::runtime::RemoteObjectId<'a>,
}
impl<'a> GetFileInfoParamsBuilder<'a> {
pub fn build(self) -> GetFileInfoParams<'a> {
GetFileInfoParams {
object_id: self.object_id,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetFileInfoReturns<'a> {
path: Cow<'a, str>,
}
impl<'a> GetFileInfoReturns<'a> {
pub fn builder(path: impl Into<Cow<'a, str>>) -> GetFileInfoReturnsBuilder<'a> {
GetFileInfoReturnsBuilder {
path: path.into(),
}
}
pub fn path(&self) -> &str { self.path.as_ref() }
}
pub struct GetFileInfoReturnsBuilder<'a> {
path: Cow<'a, str>,
}
impl<'a> GetFileInfoReturnsBuilder<'a> {
pub fn build(self) -> GetFileInfoReturns<'a> {
GetFileInfoReturns {
path: self.path,
}
}
}
impl<'a> GetFileInfoParams<'a> { pub const METHOD: &'static str = "DOM.getFileInfo"; }
impl<'a> crate::CdpCommand<'a> for GetFileInfoParams<'a> {
const METHOD: &'static str = "DOM.getFileInfo";
type Response = GetFileInfoReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetDetachedDomNodesReturns<'a> {
#[serde(rename = "detachedNodes")]
detached_nodes: Vec<DetachedElementInfo<'a>>,
}
impl<'a> GetDetachedDomNodesReturns<'a> {
pub fn builder(detached_nodes: Vec<DetachedElementInfo<'a>>) -> GetDetachedDomNodesReturnsBuilder<'a> {
GetDetachedDomNodesReturnsBuilder {
detached_nodes: detached_nodes,
}
}
pub fn detached_nodes(&self) -> &[DetachedElementInfo<'a>] { &self.detached_nodes }
}
pub struct GetDetachedDomNodesReturnsBuilder<'a> {
detached_nodes: Vec<DetachedElementInfo<'a>>,
}
impl<'a> GetDetachedDomNodesReturnsBuilder<'a> {
pub fn build(self) -> GetDetachedDomNodesReturns<'a> {
GetDetachedDomNodesReturns {
detached_nodes: self.detached_nodes,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct GetDetachedDomNodesParams {}
impl GetDetachedDomNodesParams { pub const METHOD: &'static str = "DOM.getDetachedDomNodes"; }
impl<'a> crate::CdpCommand<'a> for GetDetachedDomNodesParams {
const METHOD: &'static str = "DOM.getDetachedDomNodes";
type Response = GetDetachedDomNodesReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetInspectedNodeParams {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl SetInspectedNodeParams {
pub fn builder(node_id: NodeId) -> SetInspectedNodeParamsBuilder {
SetInspectedNodeParamsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct SetInspectedNodeParamsBuilder {
node_id: NodeId,
}
impl SetInspectedNodeParamsBuilder {
pub fn build(self) -> SetInspectedNodeParams {
SetInspectedNodeParams {
node_id: self.node_id,
}
}
}
impl SetInspectedNodeParams { pub const METHOD: &'static str = "DOM.setInspectedNode"; }
impl<'a> crate::CdpCommand<'a> for SetInspectedNodeParams {
const METHOD: &'static str = "DOM.setInspectedNode";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetNodeNameParams<'a> {
#[serde(rename = "nodeId")]
node_id: NodeId,
name: Cow<'a, str>,
}
impl<'a> SetNodeNameParams<'a> {
pub fn builder(node_id: NodeId, name: impl Into<Cow<'a, str>>) -> SetNodeNameParamsBuilder<'a> {
SetNodeNameParamsBuilder {
node_id: node_id,
name: name.into(),
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn name(&self) -> &str { self.name.as_ref() }
}
pub struct SetNodeNameParamsBuilder<'a> {
node_id: NodeId,
name: Cow<'a, str>,
}
impl<'a> SetNodeNameParamsBuilder<'a> {
pub fn build(self) -> SetNodeNameParams<'a> {
SetNodeNameParams {
node_id: self.node_id,
name: self.name,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetNodeNameReturns {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl SetNodeNameReturns {
pub fn builder(node_id: NodeId) -> SetNodeNameReturnsBuilder {
SetNodeNameReturnsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct SetNodeNameReturnsBuilder {
node_id: NodeId,
}
impl SetNodeNameReturnsBuilder {
pub fn build(self) -> SetNodeNameReturns {
SetNodeNameReturns {
node_id: self.node_id,
}
}
}
impl<'a> SetNodeNameParams<'a> { pub const METHOD: &'static str = "DOM.setNodeName"; }
impl<'a> crate::CdpCommand<'a> for SetNodeNameParams<'a> {
const METHOD: &'static str = "DOM.setNodeName";
type Response = SetNodeNameReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetNodeValueParams<'a> {
#[serde(rename = "nodeId")]
node_id: NodeId,
value: Cow<'a, str>,
}
impl<'a> SetNodeValueParams<'a> {
pub fn builder(node_id: NodeId, value: impl Into<Cow<'a, str>>) -> SetNodeValueParamsBuilder<'a> {
SetNodeValueParamsBuilder {
node_id: node_id,
value: value.into(),
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn value(&self) -> &str { self.value.as_ref() }
}
pub struct SetNodeValueParamsBuilder<'a> {
node_id: NodeId,
value: Cow<'a, str>,
}
impl<'a> SetNodeValueParamsBuilder<'a> {
pub fn build(self) -> SetNodeValueParams<'a> {
SetNodeValueParams {
node_id: self.node_id,
value: self.value,
}
}
}
impl<'a> SetNodeValueParams<'a> { pub const METHOD: &'static str = "DOM.setNodeValue"; }
impl<'a> crate::CdpCommand<'a> for SetNodeValueParams<'a> {
const METHOD: &'static str = "DOM.setNodeValue";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetOuterHTMLParams<'a> {
#[serde(rename = "nodeId")]
node_id: NodeId,
#[serde(rename = "outerHTML")]
outer_html: Cow<'a, str>,
}
impl<'a> SetOuterHTMLParams<'a> {
pub fn builder(node_id: NodeId, outer_html: impl Into<Cow<'a, str>>) -> SetOuterHTMLParamsBuilder<'a> {
SetOuterHTMLParamsBuilder {
node_id: node_id,
outer_html: outer_html.into(),
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn outer_html(&self) -> &str { self.outer_html.as_ref() }
}
pub struct SetOuterHTMLParamsBuilder<'a> {
node_id: NodeId,
outer_html: Cow<'a, str>,
}
impl<'a> SetOuterHTMLParamsBuilder<'a> {
pub fn build(self) -> SetOuterHTMLParams<'a> {
SetOuterHTMLParams {
node_id: self.node_id,
outer_html: self.outer_html,
}
}
}
impl<'a> SetOuterHTMLParams<'a> { pub const METHOD: &'static str = "DOM.setOuterHTML"; }
impl<'a> crate::CdpCommand<'a> for SetOuterHTMLParams<'a> {
const METHOD: &'static str = "DOM.setOuterHTML";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct UndoParams {}
impl UndoParams { pub const METHOD: &'static str = "DOM.undo"; }
impl<'a> crate::CdpCommand<'a> for UndoParams {
const METHOD: &'static str = "DOM.undo";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetFrameOwnerParams<'a> {
#[serde(rename = "frameId")]
frame_id: crate::page::FrameId<'a>,
}
impl<'a> GetFrameOwnerParams<'a> {
pub fn builder(frame_id: crate::page::FrameId<'a>) -> GetFrameOwnerParamsBuilder<'a> {
GetFrameOwnerParamsBuilder {
frame_id: frame_id,
}
}
pub fn frame_id(&self) -> &crate::page::FrameId<'a> { &self.frame_id }
}
pub struct GetFrameOwnerParamsBuilder<'a> {
frame_id: crate::page::FrameId<'a>,
}
impl<'a> GetFrameOwnerParamsBuilder<'a> {
pub fn build(self) -> GetFrameOwnerParams<'a> {
GetFrameOwnerParams {
frame_id: self.frame_id,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetFrameOwnerReturns {
#[serde(rename = "backendNodeId")]
backend_node_id: BackendNodeId,
#[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
node_id: Option<NodeId>,
}
impl GetFrameOwnerReturns {
pub fn builder(backend_node_id: BackendNodeId) -> GetFrameOwnerReturnsBuilder {
GetFrameOwnerReturnsBuilder {
backend_node_id: backend_node_id,
node_id: None,
}
}
pub fn backend_node_id(&self) -> &BackendNodeId { &self.backend_node_id }
pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
}
pub struct GetFrameOwnerReturnsBuilder {
backend_node_id: BackendNodeId,
node_id: Option<NodeId>,
}
impl GetFrameOwnerReturnsBuilder {
pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
pub fn build(self) -> GetFrameOwnerReturns {
GetFrameOwnerReturns {
backend_node_id: self.backend_node_id,
node_id: self.node_id,
}
}
}
impl<'a> GetFrameOwnerParams<'a> { pub const METHOD: &'static str = "DOM.getFrameOwner"; }
impl<'a> crate::CdpCommand<'a> for GetFrameOwnerParams<'a> {
const METHOD: &'static str = "DOM.getFrameOwner";
type Response = GetFrameOwnerReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetContainerForNodeParams<'a> {
#[serde(rename = "nodeId")]
node_id: NodeId,
#[serde(skip_serializing_if = "Option::is_none", rename = "containerName")]
container_name: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "physicalAxes")]
physical_axes: Option<PhysicalAxes>,
#[serde(skip_serializing_if = "Option::is_none", rename = "logicalAxes")]
logical_axes: Option<LogicalAxes>,
#[serde(skip_serializing_if = "Option::is_none", rename = "queriesScrollState")]
queries_scroll_state: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", rename = "queriesAnchored")]
queries_anchored: Option<bool>,
}
impl<'a> GetContainerForNodeParams<'a> {
pub fn builder(node_id: NodeId) -> GetContainerForNodeParamsBuilder<'a> {
GetContainerForNodeParamsBuilder {
node_id: node_id,
container_name: None,
physical_axes: None,
logical_axes: None,
queries_scroll_state: None,
queries_anchored: None,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn container_name(&self) -> Option<&str> { self.container_name.as_deref() }
pub fn physical_axes(&self) -> Option<&PhysicalAxes> { self.physical_axes.as_ref() }
pub fn logical_axes(&self) -> Option<&LogicalAxes> { self.logical_axes.as_ref() }
pub fn queries_scroll_state(&self) -> Option<bool> { self.queries_scroll_state }
pub fn queries_anchored(&self) -> Option<bool> { self.queries_anchored }
}
pub struct GetContainerForNodeParamsBuilder<'a> {
node_id: NodeId,
container_name: Option<Cow<'a, str>>,
physical_axes: Option<PhysicalAxes>,
logical_axes: Option<LogicalAxes>,
queries_scroll_state: Option<bool>,
queries_anchored: Option<bool>,
}
impl<'a> GetContainerForNodeParamsBuilder<'a> {
pub fn container_name(mut self, container_name: impl Into<Cow<'a, str>>) -> Self { self.container_name = Some(container_name.into()); self }
pub fn physical_axes(mut self, physical_axes: impl Into<PhysicalAxes>) -> Self { self.physical_axes = Some(physical_axes.into()); self }
pub fn logical_axes(mut self, logical_axes: impl Into<LogicalAxes>) -> Self { self.logical_axes = Some(logical_axes.into()); self }
pub fn queries_scroll_state(mut self, queries_scroll_state: bool) -> Self { self.queries_scroll_state = Some(queries_scroll_state); self }
pub fn queries_anchored(mut self, queries_anchored: bool) -> Self { self.queries_anchored = Some(queries_anchored); self }
pub fn build(self) -> GetContainerForNodeParams<'a> {
GetContainerForNodeParams {
node_id: self.node_id,
container_name: self.container_name,
physical_axes: self.physical_axes,
logical_axes: self.logical_axes,
queries_scroll_state: self.queries_scroll_state,
queries_anchored: self.queries_anchored,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetContainerForNodeReturns {
#[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
node_id: Option<NodeId>,
}
impl GetContainerForNodeReturns {
pub fn builder() -> GetContainerForNodeReturnsBuilder {
GetContainerForNodeReturnsBuilder {
node_id: None,
}
}
pub fn node_id(&self) -> Option<&NodeId> { self.node_id.as_ref() }
}
#[derive(Default)]
pub struct GetContainerForNodeReturnsBuilder {
node_id: Option<NodeId>,
}
impl GetContainerForNodeReturnsBuilder {
pub fn node_id(mut self, node_id: NodeId) -> Self { self.node_id = Some(node_id); self }
pub fn build(self) -> GetContainerForNodeReturns {
GetContainerForNodeReturns {
node_id: self.node_id,
}
}
}
impl<'a> GetContainerForNodeParams<'a> { pub const METHOD: &'static str = "DOM.getContainerForNode"; }
impl<'a> crate::CdpCommand<'a> for GetContainerForNodeParams<'a> {
const METHOD: &'static str = "DOM.getContainerForNode";
type Response = GetContainerForNodeReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetQueryingDescendantsForContainerParams {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl GetQueryingDescendantsForContainerParams {
pub fn builder(node_id: NodeId) -> GetQueryingDescendantsForContainerParamsBuilder {
GetQueryingDescendantsForContainerParamsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct GetQueryingDescendantsForContainerParamsBuilder {
node_id: NodeId,
}
impl GetQueryingDescendantsForContainerParamsBuilder {
pub fn build(self) -> GetQueryingDescendantsForContainerParams {
GetQueryingDescendantsForContainerParams {
node_id: self.node_id,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetQueryingDescendantsForContainerReturns {
#[serde(rename = "nodeIds")]
node_ids: Vec<NodeId>,
}
impl GetQueryingDescendantsForContainerReturns {
pub fn builder(node_ids: Vec<NodeId>) -> GetQueryingDescendantsForContainerReturnsBuilder {
GetQueryingDescendantsForContainerReturnsBuilder {
node_ids: node_ids,
}
}
pub fn node_ids(&self) -> &[NodeId] { &self.node_ids }
}
pub struct GetQueryingDescendantsForContainerReturnsBuilder {
node_ids: Vec<NodeId>,
}
impl GetQueryingDescendantsForContainerReturnsBuilder {
pub fn build(self) -> GetQueryingDescendantsForContainerReturns {
GetQueryingDescendantsForContainerReturns {
node_ids: self.node_ids,
}
}
}
impl GetQueryingDescendantsForContainerParams { pub const METHOD: &'static str = "DOM.getQueryingDescendantsForContainer"; }
impl<'a> crate::CdpCommand<'a> for GetQueryingDescendantsForContainerParams {
const METHOD: &'static str = "DOM.getQueryingDescendantsForContainer";
type Response = GetQueryingDescendantsForContainerReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetAnchorElementParams<'a> {
#[serde(rename = "nodeId")]
node_id: NodeId,
#[serde(skip_serializing_if = "Option::is_none", rename = "anchorSpecifier")]
anchor_specifier: Option<Cow<'a, str>>,
}
impl<'a> GetAnchorElementParams<'a> {
pub fn builder(node_id: NodeId) -> GetAnchorElementParamsBuilder<'a> {
GetAnchorElementParamsBuilder {
node_id: node_id,
anchor_specifier: None,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn anchor_specifier(&self) -> Option<&str> { self.anchor_specifier.as_deref() }
}
pub struct GetAnchorElementParamsBuilder<'a> {
node_id: NodeId,
anchor_specifier: Option<Cow<'a, str>>,
}
impl<'a> GetAnchorElementParamsBuilder<'a> {
pub fn anchor_specifier(mut self, anchor_specifier: impl Into<Cow<'a, str>>) -> Self { self.anchor_specifier = Some(anchor_specifier.into()); self }
pub fn build(self) -> GetAnchorElementParams<'a> {
GetAnchorElementParams {
node_id: self.node_id,
anchor_specifier: self.anchor_specifier,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetAnchorElementReturns {
#[serde(rename = "nodeId")]
node_id: NodeId,
}
impl GetAnchorElementReturns {
pub fn builder(node_id: NodeId) -> GetAnchorElementReturnsBuilder {
GetAnchorElementReturnsBuilder {
node_id: node_id,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
}
pub struct GetAnchorElementReturnsBuilder {
node_id: NodeId,
}
impl GetAnchorElementReturnsBuilder {
pub fn build(self) -> GetAnchorElementReturns {
GetAnchorElementReturns {
node_id: self.node_id,
}
}
}
impl<'a> GetAnchorElementParams<'a> { pub const METHOD: &'static str = "DOM.getAnchorElement"; }
impl<'a> crate::CdpCommand<'a> for GetAnchorElementParams<'a> {
const METHOD: &'static str = "DOM.getAnchorElement";
type Response = GetAnchorElementReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ForceShowPopoverParams {
#[serde(rename = "nodeId")]
node_id: NodeId,
enable: bool,
}
impl ForceShowPopoverParams {
pub fn builder(node_id: NodeId, enable: bool) -> ForceShowPopoverParamsBuilder {
ForceShowPopoverParamsBuilder {
node_id: node_id,
enable: enable,
}
}
pub fn node_id(&self) -> &NodeId { &self.node_id }
pub fn enable(&self) -> bool { self.enable }
}
pub struct ForceShowPopoverParamsBuilder {
node_id: NodeId,
enable: bool,
}
impl ForceShowPopoverParamsBuilder {
pub fn build(self) -> ForceShowPopoverParams {
ForceShowPopoverParams {
node_id: self.node_id,
enable: self.enable,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ForceShowPopoverReturns {
#[serde(rename = "nodeIds")]
node_ids: Vec<NodeId>,
}
impl ForceShowPopoverReturns {
pub fn builder(node_ids: Vec<NodeId>) -> ForceShowPopoverReturnsBuilder {
ForceShowPopoverReturnsBuilder {
node_ids: node_ids,
}
}
pub fn node_ids(&self) -> &[NodeId] { &self.node_ids }
}
pub struct ForceShowPopoverReturnsBuilder {
node_ids: Vec<NodeId>,
}
impl ForceShowPopoverReturnsBuilder {
pub fn build(self) -> ForceShowPopoverReturns {
ForceShowPopoverReturns {
node_ids: self.node_ids,
}
}
}
impl ForceShowPopoverParams { pub const METHOD: &'static str = "DOM.forceShowPopover"; }
impl<'a> crate::CdpCommand<'a> for ForceShowPopoverParams {
const METHOD: &'static str = "DOM.forceShowPopover";
type Response = ForceShowPopoverReturns;
}