use serde::{Serialize, Deserialize};
use serde_json::Value as JsonValue;
use std::borrow::Cow;
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DOMNode<'a> {
#[serde(rename = "nodeType")]
node_type: i64,
#[serde(rename = "nodeName")]
node_name: Cow<'a, str>,
#[serde(rename = "nodeValue")]
node_value: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none", rename = "textValue")]
text_value: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "inputValue")]
input_value: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "inputChecked")]
input_checked: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", rename = "optionSelected")]
option_selected: Option<bool>,
#[serde(rename = "backendNodeId")]
backend_node_id: crate::dom::BackendNodeId,
#[serde(skip_serializing_if = "Option::is_none", rename = "childNodeIndexes")]
child_node_indexes: Option<Vec<i64>>,
#[serde(skip_serializing_if = "Option::is_none")]
attributes: Option<Vec<NameValue<'a>>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "pseudoElementIndexes")]
pseudo_element_indexes: Option<Vec<i64>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "layoutNodeIndex")]
layout_node_index: Option<u64>,
#[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 = "contentLanguage")]
content_language: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "documentEncoding")]
document_encoding: 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 = "frameId")]
frame_id: Option<crate::page::FrameId<'a>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "contentDocumentIndex")]
content_document_index: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none", rename = "pseudoType")]
pseudo_type: Option<crate::dom::PseudoType>,
#[serde(skip_serializing_if = "Option::is_none", rename = "shadowRootType")]
shadow_root_type: Option<crate::dom::ShadowRootType>,
#[serde(skip_serializing_if = "Option::is_none", rename = "isClickable")]
is_clickable: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", rename = "eventListeners")]
event_listeners: Option<Vec<crate::domdebugger::EventListener<'a>>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "currentSourceURL")]
current_source_url: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "originURL")]
origin_url: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "scrollOffsetX")]
scroll_offset_x: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none", rename = "scrollOffsetY")]
scroll_offset_y: Option<f64>,
}
impl<'a> DOMNode<'a> {
pub fn builder(node_type: i64, node_name: impl Into<Cow<'a, str>>, node_value: impl Into<Cow<'a, str>>, backend_node_id: crate::dom::BackendNodeId) -> DOMNodeBuilder<'a> {
DOMNodeBuilder {
node_type: node_type,
node_name: node_name.into(),
node_value: node_value.into(),
text_value: None,
input_value: None,
input_checked: None,
option_selected: None,
backend_node_id: backend_node_id,
child_node_indexes: None,
attributes: None,
pseudo_element_indexes: None,
layout_node_index: None,
document_url: None,
base_url: None,
content_language: None,
document_encoding: None,
public_id: None,
system_id: None,
frame_id: None,
content_document_index: None,
pseudo_type: None,
shadow_root_type: None,
is_clickable: None,
event_listeners: None,
current_source_url: None,
origin_url: None,
scroll_offset_x: None,
scroll_offset_y: None,
}
}
pub fn node_type(&self) -> i64 { self.node_type }
pub fn node_name(&self) -> &str { self.node_name.as_ref() }
pub fn node_value(&self) -> &str { self.node_value.as_ref() }
pub fn text_value(&self) -> Option<&str> { self.text_value.as_deref() }
pub fn input_value(&self) -> Option<&str> { self.input_value.as_deref() }
pub fn input_checked(&self) -> Option<bool> { self.input_checked }
pub fn option_selected(&self) -> Option<bool> { self.option_selected }
pub fn backend_node_id(&self) -> &crate::dom::BackendNodeId { &self.backend_node_id }
pub fn child_node_indexes(&self) -> Option<&[i64]> { self.child_node_indexes.as_deref() }
pub fn attributes(&self) -> Option<&[NameValue<'a>]> { self.attributes.as_deref() }
pub fn pseudo_element_indexes(&self) -> Option<&[i64]> { self.pseudo_element_indexes.as_deref() }
pub fn layout_node_index(&self) -> Option<u64> { self.layout_node_index }
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 content_language(&self) -> Option<&str> { self.content_language.as_deref() }
pub fn document_encoding(&self) -> Option<&str> { self.document_encoding.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 frame_id(&self) -> Option<&crate::page::FrameId<'a>> { self.frame_id.as_ref() }
pub fn content_document_index(&self) -> Option<u64> { self.content_document_index }
pub fn pseudo_type(&self) -> Option<&crate::dom::PseudoType> { self.pseudo_type.as_ref() }
pub fn shadow_root_type(&self) -> Option<&crate::dom::ShadowRootType> { self.shadow_root_type.as_ref() }
pub fn is_clickable(&self) -> Option<bool> { self.is_clickable }
pub fn event_listeners(&self) -> Option<&[crate::domdebugger::EventListener<'a>]> { self.event_listeners.as_deref() }
pub fn current_source_url(&self) -> Option<&str> { self.current_source_url.as_deref() }
pub fn origin_url(&self) -> Option<&str> { self.origin_url.as_deref() }
pub fn scroll_offset_x(&self) -> Option<f64> { self.scroll_offset_x }
pub fn scroll_offset_y(&self) -> Option<f64> { self.scroll_offset_y }
}
pub struct DOMNodeBuilder<'a> {
node_type: i64,
node_name: Cow<'a, str>,
node_value: Cow<'a, str>,
text_value: Option<Cow<'a, str>>,
input_value: Option<Cow<'a, str>>,
input_checked: Option<bool>,
option_selected: Option<bool>,
backend_node_id: crate::dom::BackendNodeId,
child_node_indexes: Option<Vec<i64>>,
attributes: Option<Vec<NameValue<'a>>>,
pseudo_element_indexes: Option<Vec<i64>>,
layout_node_index: Option<u64>,
document_url: Option<Cow<'a, str>>,
base_url: Option<Cow<'a, str>>,
content_language: Option<Cow<'a, str>>,
document_encoding: Option<Cow<'a, str>>,
public_id: Option<Cow<'a, str>>,
system_id: Option<Cow<'a, str>>,
frame_id: Option<crate::page::FrameId<'a>>,
content_document_index: Option<u64>,
pseudo_type: Option<crate::dom::PseudoType>,
shadow_root_type: Option<crate::dom::ShadowRootType>,
is_clickable: Option<bool>,
event_listeners: Option<Vec<crate::domdebugger::EventListener<'a>>>,
current_source_url: Option<Cow<'a, str>>,
origin_url: Option<Cow<'a, str>>,
scroll_offset_x: Option<f64>,
scroll_offset_y: Option<f64>,
}
impl<'a> DOMNodeBuilder<'a> {
pub fn text_value(mut self, text_value: impl Into<Cow<'a, str>>) -> Self { self.text_value = Some(text_value.into()); self }
pub fn input_value(mut self, input_value: impl Into<Cow<'a, str>>) -> Self { self.input_value = Some(input_value.into()); self }
pub fn input_checked(mut self, input_checked: bool) -> Self { self.input_checked = Some(input_checked); self }
pub fn option_selected(mut self, option_selected: bool) -> Self { self.option_selected = Some(option_selected); self }
pub fn child_node_indexes(mut self, child_node_indexes: Vec<i64>) -> Self { self.child_node_indexes = Some(child_node_indexes); self }
pub fn attributes(mut self, attributes: Vec<NameValue<'a>>) -> Self { self.attributes = Some(attributes); self }
pub fn pseudo_element_indexes(mut self, pseudo_element_indexes: Vec<i64>) -> Self { self.pseudo_element_indexes = Some(pseudo_element_indexes); self }
pub fn layout_node_index(mut self, layout_node_index: u64) -> Self { self.layout_node_index = Some(layout_node_index); 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 content_language(mut self, content_language: impl Into<Cow<'a, str>>) -> Self { self.content_language = Some(content_language.into()); self }
pub fn document_encoding(mut self, document_encoding: impl Into<Cow<'a, str>>) -> Self { self.document_encoding = Some(document_encoding.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 frame_id(mut self, frame_id: crate::page::FrameId<'a>) -> Self { self.frame_id = Some(frame_id); self }
pub fn content_document_index(mut self, content_document_index: u64) -> Self { self.content_document_index = Some(content_document_index); self }
pub fn pseudo_type(mut self, pseudo_type: crate::dom::PseudoType) -> Self { self.pseudo_type = Some(pseudo_type); self }
pub fn shadow_root_type(mut self, shadow_root_type: crate::dom::ShadowRootType) -> Self { self.shadow_root_type = Some(shadow_root_type); self }
pub fn is_clickable(mut self, is_clickable: bool) -> Self { self.is_clickable = Some(is_clickable); self }
pub fn event_listeners(mut self, event_listeners: Vec<crate::domdebugger::EventListener<'a>>) -> Self { self.event_listeners = Some(event_listeners); self }
pub fn current_source_url(mut self, current_source_url: impl Into<Cow<'a, str>>) -> Self { self.current_source_url = Some(current_source_url.into()); self }
pub fn origin_url(mut self, origin_url: impl Into<Cow<'a, str>>) -> Self { self.origin_url = Some(origin_url.into()); self }
pub fn scroll_offset_x(mut self, scroll_offset_x: f64) -> Self { self.scroll_offset_x = Some(scroll_offset_x); self }
pub fn scroll_offset_y(mut self, scroll_offset_y: f64) -> Self { self.scroll_offset_y = Some(scroll_offset_y); self }
pub fn build(self) -> DOMNode<'a> {
DOMNode {
node_type: self.node_type,
node_name: self.node_name,
node_value: self.node_value,
text_value: self.text_value,
input_value: self.input_value,
input_checked: self.input_checked,
option_selected: self.option_selected,
backend_node_id: self.backend_node_id,
child_node_indexes: self.child_node_indexes,
attributes: self.attributes,
pseudo_element_indexes: self.pseudo_element_indexes,
layout_node_index: self.layout_node_index,
document_url: self.document_url,
base_url: self.base_url,
content_language: self.content_language,
document_encoding: self.document_encoding,
public_id: self.public_id,
system_id: self.system_id,
frame_id: self.frame_id,
content_document_index: self.content_document_index,
pseudo_type: self.pseudo_type,
shadow_root_type: self.shadow_root_type,
is_clickable: self.is_clickable,
event_listeners: self.event_listeners,
current_source_url: self.current_source_url,
origin_url: self.origin_url,
scroll_offset_x: self.scroll_offset_x,
scroll_offset_y: self.scroll_offset_y,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct InlineTextBox {
#[serde(rename = "boundingBox")]
bounding_box: crate::dom::Rect,
#[serde(rename = "startCharacterIndex")]
start_character_index: u64,
#[serde(rename = "numCharacters")]
num_characters: i64,
}
impl InlineTextBox {
pub fn builder(bounding_box: crate::dom::Rect, start_character_index: u64, num_characters: i64) -> InlineTextBoxBuilder {
InlineTextBoxBuilder {
bounding_box: bounding_box,
start_character_index: start_character_index,
num_characters: num_characters,
}
}
pub fn bounding_box(&self) -> &crate::dom::Rect { &self.bounding_box }
pub fn start_character_index(&self) -> u64 { self.start_character_index }
pub fn num_characters(&self) -> i64 { self.num_characters }
}
pub struct InlineTextBoxBuilder {
bounding_box: crate::dom::Rect,
start_character_index: u64,
num_characters: i64,
}
impl InlineTextBoxBuilder {
pub fn build(self) -> InlineTextBox {
InlineTextBox {
bounding_box: self.bounding_box,
start_character_index: self.start_character_index,
num_characters: self.num_characters,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct LayoutTreeNode<'a> {
#[serde(rename = "domNodeIndex")]
dom_node_index: u64,
#[serde(rename = "boundingBox")]
bounding_box: crate::dom::Rect,
#[serde(skip_serializing_if = "Option::is_none", rename = "layoutText")]
layout_text: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "inlineTextNodes")]
inline_text_nodes: Option<Vec<InlineTextBox>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "styleIndex")]
style_index: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none", rename = "paintOrder")]
paint_order: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none", rename = "isStackingContext")]
is_stacking_context: Option<bool>,
}
impl<'a> LayoutTreeNode<'a> {
pub fn builder(dom_node_index: u64, bounding_box: crate::dom::Rect) -> LayoutTreeNodeBuilder<'a> {
LayoutTreeNodeBuilder {
dom_node_index: dom_node_index,
bounding_box: bounding_box,
layout_text: None,
inline_text_nodes: None,
style_index: None,
paint_order: None,
is_stacking_context: None,
}
}
pub fn dom_node_index(&self) -> u64 { self.dom_node_index }
pub fn bounding_box(&self) -> &crate::dom::Rect { &self.bounding_box }
pub fn layout_text(&self) -> Option<&str> { self.layout_text.as_deref() }
pub fn inline_text_nodes(&self) -> Option<&[InlineTextBox]> { self.inline_text_nodes.as_deref() }
pub fn style_index(&self) -> Option<u64> { self.style_index }
pub fn paint_order(&self) -> Option<i64> { self.paint_order }
pub fn is_stacking_context(&self) -> Option<bool> { self.is_stacking_context }
}
pub struct LayoutTreeNodeBuilder<'a> {
dom_node_index: u64,
bounding_box: crate::dom::Rect,
layout_text: Option<Cow<'a, str>>,
inline_text_nodes: Option<Vec<InlineTextBox>>,
style_index: Option<u64>,
paint_order: Option<i64>,
is_stacking_context: Option<bool>,
}
impl<'a> LayoutTreeNodeBuilder<'a> {
pub fn layout_text(mut self, layout_text: impl Into<Cow<'a, str>>) -> Self { self.layout_text = Some(layout_text.into()); self }
pub fn inline_text_nodes(mut self, inline_text_nodes: Vec<InlineTextBox>) -> Self { self.inline_text_nodes = Some(inline_text_nodes); self }
pub fn style_index(mut self, style_index: u64) -> Self { self.style_index = Some(style_index); self }
pub fn paint_order(mut self, paint_order: i64) -> Self { self.paint_order = Some(paint_order); self }
pub fn is_stacking_context(mut self, is_stacking_context: bool) -> Self { self.is_stacking_context = Some(is_stacking_context); self }
pub fn build(self) -> LayoutTreeNode<'a> {
LayoutTreeNode {
dom_node_index: self.dom_node_index,
bounding_box: self.bounding_box,
layout_text: self.layout_text,
inline_text_nodes: self.inline_text_nodes,
style_index: self.style_index,
paint_order: self.paint_order,
is_stacking_context: self.is_stacking_context,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ComputedStyle<'a> {
properties: Vec<NameValue<'a>>,
}
impl<'a> ComputedStyle<'a> {
pub fn builder(properties: Vec<NameValue<'a>>) -> ComputedStyleBuilder<'a> {
ComputedStyleBuilder {
properties: properties,
}
}
pub fn properties(&self) -> &[NameValue<'a>] { &self.properties }
}
pub struct ComputedStyleBuilder<'a> {
properties: Vec<NameValue<'a>>,
}
impl<'a> ComputedStyleBuilder<'a> {
pub fn build(self) -> ComputedStyle<'a> {
ComputedStyle {
properties: self.properties,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct NameValue<'a> {
name: Cow<'a, str>,
value: Cow<'a, str>,
}
impl<'a> NameValue<'a> {
pub fn builder(name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> NameValueBuilder<'a> {
NameValueBuilder {
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 NameValueBuilder<'a> {
name: Cow<'a, str>,
value: Cow<'a, str>,
}
impl<'a> NameValueBuilder<'a> {
pub fn build(self) -> NameValue<'a> {
NameValue {
name: self.name,
value: self.value,
}
}
}
pub type StringIndex = i64;
pub type ArrayOfStrings = Vec<StringIndex>;
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RareStringData {
index: Vec<i64>,
value: Vec<StringIndex>,
}
impl RareStringData {
pub fn builder(index: Vec<i64>, value: Vec<StringIndex>) -> RareStringDataBuilder {
RareStringDataBuilder {
index: index,
value: value,
}
}
pub fn index(&self) -> &[i64] { &self.index }
pub fn value(&self) -> &[StringIndex] { &self.value }
}
pub struct RareStringDataBuilder {
index: Vec<i64>,
value: Vec<StringIndex>,
}
impl RareStringDataBuilder {
pub fn build(self) -> RareStringData {
RareStringData {
index: self.index,
value: self.value,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RareBooleanData {
index: Vec<i64>,
}
impl RareBooleanData {
pub fn builder(index: Vec<i64>) -> RareBooleanDataBuilder {
RareBooleanDataBuilder {
index: index,
}
}
pub fn index(&self) -> &[i64] { &self.index }
}
pub struct RareBooleanDataBuilder {
index: Vec<i64>,
}
impl RareBooleanDataBuilder {
pub fn build(self) -> RareBooleanData {
RareBooleanData {
index: self.index,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RareIntegerData {
index: Vec<i64>,
value: Vec<i64>,
}
impl RareIntegerData {
pub fn builder(index: Vec<i64>, value: Vec<i64>) -> RareIntegerDataBuilder {
RareIntegerDataBuilder {
index: index,
value: value,
}
}
pub fn index(&self) -> &[i64] { &self.index }
pub fn value(&self) -> &[i64] { &self.value }
}
pub struct RareIntegerDataBuilder {
index: Vec<i64>,
value: Vec<i64>,
}
impl RareIntegerDataBuilder {
pub fn build(self) -> RareIntegerData {
RareIntegerData {
index: self.index,
value: self.value,
}
}
}
pub type Rectangle = Vec<f64>;
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DocumentSnapshot {
#[serde(rename = "documentURL")]
document_url: StringIndex,
title: StringIndex,
#[serde(rename = "baseURL")]
base_url: StringIndex,
#[serde(rename = "contentLanguage")]
content_language: StringIndex,
#[serde(rename = "encodingName")]
encoding_name: StringIndex,
#[serde(rename = "publicId")]
public_id: StringIndex,
#[serde(rename = "systemId")]
system_id: StringIndex,
#[serde(rename = "frameId")]
frame_id: StringIndex,
nodes: NodeTreeSnapshot,
layout: LayoutTreeSnapshot,
#[serde(rename = "textBoxes")]
text_boxes: TextBoxSnapshot,
#[serde(skip_serializing_if = "Option::is_none", rename = "scrollOffsetX")]
scroll_offset_x: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none", rename = "scrollOffsetY")]
scroll_offset_y: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none", rename = "contentWidth")]
content_width: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none", rename = "contentHeight")]
content_height: Option<f64>,
}
impl DocumentSnapshot {
pub fn builder(document_url: StringIndex, title: StringIndex, base_url: StringIndex, content_language: StringIndex, encoding_name: StringIndex, public_id: StringIndex, system_id: StringIndex, frame_id: StringIndex, nodes: NodeTreeSnapshot, layout: LayoutTreeSnapshot, text_boxes: TextBoxSnapshot) -> DocumentSnapshotBuilder {
DocumentSnapshotBuilder {
document_url: document_url,
title: title,
base_url: base_url,
content_language: content_language,
encoding_name: encoding_name,
public_id: public_id,
system_id: system_id,
frame_id: frame_id,
nodes: nodes,
layout: layout,
text_boxes: text_boxes,
scroll_offset_x: None,
scroll_offset_y: None,
content_width: None,
content_height: None,
}
}
pub fn document_url(&self) -> &StringIndex { &self.document_url }
pub fn title(&self) -> &StringIndex { &self.title }
pub fn base_url(&self) -> &StringIndex { &self.base_url }
pub fn content_language(&self) -> &StringIndex { &self.content_language }
pub fn encoding_name(&self) -> &StringIndex { &self.encoding_name }
pub fn public_id(&self) -> &StringIndex { &self.public_id }
pub fn system_id(&self) -> &StringIndex { &self.system_id }
pub fn frame_id(&self) -> &StringIndex { &self.frame_id }
pub fn nodes(&self) -> &NodeTreeSnapshot { &self.nodes }
pub fn layout(&self) -> &LayoutTreeSnapshot { &self.layout }
pub fn text_boxes(&self) -> &TextBoxSnapshot { &self.text_boxes }
pub fn scroll_offset_x(&self) -> Option<f64> { self.scroll_offset_x }
pub fn scroll_offset_y(&self) -> Option<f64> { self.scroll_offset_y }
pub fn content_width(&self) -> Option<f64> { self.content_width }
pub fn content_height(&self) -> Option<f64> { self.content_height }
}
pub struct DocumentSnapshotBuilder {
document_url: StringIndex,
title: StringIndex,
base_url: StringIndex,
content_language: StringIndex,
encoding_name: StringIndex,
public_id: StringIndex,
system_id: StringIndex,
frame_id: StringIndex,
nodes: NodeTreeSnapshot,
layout: LayoutTreeSnapshot,
text_boxes: TextBoxSnapshot,
scroll_offset_x: Option<f64>,
scroll_offset_y: Option<f64>,
content_width: Option<f64>,
content_height: Option<f64>,
}
impl DocumentSnapshotBuilder {
pub fn scroll_offset_x(mut self, scroll_offset_x: f64) -> Self { self.scroll_offset_x = Some(scroll_offset_x); self }
pub fn scroll_offset_y(mut self, scroll_offset_y: f64) -> Self { self.scroll_offset_y = Some(scroll_offset_y); self }
pub fn content_width(mut self, content_width: f64) -> Self { self.content_width = Some(content_width); self }
pub fn content_height(mut self, content_height: f64) -> Self { self.content_height = Some(content_height); self }
pub fn build(self) -> DocumentSnapshot {
DocumentSnapshot {
document_url: self.document_url,
title: self.title,
base_url: self.base_url,
content_language: self.content_language,
encoding_name: self.encoding_name,
public_id: self.public_id,
system_id: self.system_id,
frame_id: self.frame_id,
nodes: self.nodes,
layout: self.layout,
text_boxes: self.text_boxes,
scroll_offset_x: self.scroll_offset_x,
scroll_offset_y: self.scroll_offset_y,
content_width: self.content_width,
content_height: self.content_height,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct NodeTreeSnapshot {
#[serde(skip_serializing_if = "Option::is_none", rename = "parentIndex")]
parent_index: Option<Vec<i64>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "nodeType")]
node_type: Option<Vec<i64>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "shadowRootType")]
shadow_root_type: Option<RareStringData>,
#[serde(skip_serializing_if = "Option::is_none", rename = "nodeName")]
node_name: Option<Vec<StringIndex>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "nodeValue")]
node_value: Option<Vec<StringIndex>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "backendNodeId")]
backend_node_id: Option<Vec<crate::dom::BackendNodeId>>,
#[serde(skip_serializing_if = "Option::is_none")]
attributes: Option<Vec<ArrayOfStrings>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "textValue")]
text_value: Option<RareStringData>,
#[serde(skip_serializing_if = "Option::is_none", rename = "inputValue")]
input_value: Option<RareStringData>,
#[serde(skip_serializing_if = "Option::is_none", rename = "inputChecked")]
input_checked: Option<RareBooleanData>,
#[serde(skip_serializing_if = "Option::is_none", rename = "optionSelected")]
option_selected: Option<RareBooleanData>,
#[serde(skip_serializing_if = "Option::is_none", rename = "contentDocumentIndex")]
content_document_index: Option<RareIntegerData>,
#[serde(skip_serializing_if = "Option::is_none", rename = "pseudoType")]
pseudo_type: Option<RareStringData>,
#[serde(skip_serializing_if = "Option::is_none", rename = "pseudoIdentifier")]
pseudo_identifier: Option<RareStringData>,
#[serde(skip_serializing_if = "Option::is_none", rename = "isClickable")]
is_clickable: Option<RareBooleanData>,
#[serde(skip_serializing_if = "Option::is_none", rename = "currentSourceURL")]
current_source_url: Option<RareStringData>,
#[serde(skip_serializing_if = "Option::is_none", rename = "originURL")]
origin_url: Option<RareStringData>,
}
impl NodeTreeSnapshot {
pub fn builder() -> NodeTreeSnapshotBuilder {
NodeTreeSnapshotBuilder {
parent_index: None,
node_type: None,
shadow_root_type: None,
node_name: None,
node_value: None,
backend_node_id: None,
attributes: None,
text_value: None,
input_value: None,
input_checked: None,
option_selected: None,
content_document_index: None,
pseudo_type: None,
pseudo_identifier: None,
is_clickable: None,
current_source_url: None,
origin_url: None,
}
}
pub fn parent_index(&self) -> Option<&[i64]> { self.parent_index.as_deref() }
pub fn node_type(&self) -> Option<&[i64]> { self.node_type.as_deref() }
pub fn shadow_root_type(&self) -> Option<&RareStringData> { self.shadow_root_type.as_ref() }
pub fn node_name(&self) -> Option<&[StringIndex]> { self.node_name.as_deref() }
pub fn node_value(&self) -> Option<&[StringIndex]> { self.node_value.as_deref() }
pub fn backend_node_id(&self) -> Option<&[crate::dom::BackendNodeId]> { self.backend_node_id.as_deref() }
pub fn attributes(&self) -> Option<&[ArrayOfStrings]> { self.attributes.as_deref() }
pub fn text_value(&self) -> Option<&RareStringData> { self.text_value.as_ref() }
pub fn input_value(&self) -> Option<&RareStringData> { self.input_value.as_ref() }
pub fn input_checked(&self) -> Option<&RareBooleanData> { self.input_checked.as_ref() }
pub fn option_selected(&self) -> Option<&RareBooleanData> { self.option_selected.as_ref() }
pub fn content_document_index(&self) -> Option<&RareIntegerData> { self.content_document_index.as_ref() }
pub fn pseudo_type(&self) -> Option<&RareStringData> { self.pseudo_type.as_ref() }
pub fn pseudo_identifier(&self) -> Option<&RareStringData> { self.pseudo_identifier.as_ref() }
pub fn is_clickable(&self) -> Option<&RareBooleanData> { self.is_clickable.as_ref() }
pub fn current_source_url(&self) -> Option<&RareStringData> { self.current_source_url.as_ref() }
pub fn origin_url(&self) -> Option<&RareStringData> { self.origin_url.as_ref() }
}
#[derive(Default)]
pub struct NodeTreeSnapshotBuilder {
parent_index: Option<Vec<i64>>,
node_type: Option<Vec<i64>>,
shadow_root_type: Option<RareStringData>,
node_name: Option<Vec<StringIndex>>,
node_value: Option<Vec<StringIndex>>,
backend_node_id: Option<Vec<crate::dom::BackendNodeId>>,
attributes: Option<Vec<ArrayOfStrings>>,
text_value: Option<RareStringData>,
input_value: Option<RareStringData>,
input_checked: Option<RareBooleanData>,
option_selected: Option<RareBooleanData>,
content_document_index: Option<RareIntegerData>,
pseudo_type: Option<RareStringData>,
pseudo_identifier: Option<RareStringData>,
is_clickable: Option<RareBooleanData>,
current_source_url: Option<RareStringData>,
origin_url: Option<RareStringData>,
}
impl NodeTreeSnapshotBuilder {
pub fn parent_index(mut self, parent_index: Vec<i64>) -> Self { self.parent_index = Some(parent_index); self }
pub fn node_type(mut self, node_type: Vec<i64>) -> Self { self.node_type = Some(node_type); self }
pub fn shadow_root_type(mut self, shadow_root_type: RareStringData) -> Self { self.shadow_root_type = Some(shadow_root_type); self }
pub fn node_name(mut self, node_name: Vec<StringIndex>) -> Self { self.node_name = Some(node_name); self }
pub fn node_value(mut self, node_value: Vec<StringIndex>) -> Self { self.node_value = Some(node_value); self }
pub fn backend_node_id(mut self, backend_node_id: Vec<crate::dom::BackendNodeId>) -> Self { self.backend_node_id = Some(backend_node_id); self }
pub fn attributes(mut self, attributes: Vec<ArrayOfStrings>) -> Self { self.attributes = Some(attributes); self }
pub fn text_value(mut self, text_value: RareStringData) -> Self { self.text_value = Some(text_value); self }
pub fn input_value(mut self, input_value: RareStringData) -> Self { self.input_value = Some(input_value); self }
pub fn input_checked(mut self, input_checked: RareBooleanData) -> Self { self.input_checked = Some(input_checked); self }
pub fn option_selected(mut self, option_selected: RareBooleanData) -> Self { self.option_selected = Some(option_selected); self }
pub fn content_document_index(mut self, content_document_index: RareIntegerData) -> Self { self.content_document_index = Some(content_document_index); self }
pub fn pseudo_type(mut self, pseudo_type: RareStringData) -> Self { self.pseudo_type = Some(pseudo_type); self }
pub fn pseudo_identifier(mut self, pseudo_identifier: RareStringData) -> Self { self.pseudo_identifier = Some(pseudo_identifier); self }
pub fn is_clickable(mut self, is_clickable: RareBooleanData) -> Self { self.is_clickable = Some(is_clickable); self }
pub fn current_source_url(mut self, current_source_url: RareStringData) -> Self { self.current_source_url = Some(current_source_url); self }
pub fn origin_url(mut self, origin_url: RareStringData) -> Self { self.origin_url = Some(origin_url); self }
pub fn build(self) -> NodeTreeSnapshot {
NodeTreeSnapshot {
parent_index: self.parent_index,
node_type: self.node_type,
shadow_root_type: self.shadow_root_type,
node_name: self.node_name,
node_value: self.node_value,
backend_node_id: self.backend_node_id,
attributes: self.attributes,
text_value: self.text_value,
input_value: self.input_value,
input_checked: self.input_checked,
option_selected: self.option_selected,
content_document_index: self.content_document_index,
pseudo_type: self.pseudo_type,
pseudo_identifier: self.pseudo_identifier,
is_clickable: self.is_clickable,
current_source_url: self.current_source_url,
origin_url: self.origin_url,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct LayoutTreeSnapshot {
#[serde(rename = "nodeIndex")]
node_index: Vec<i64>,
styles: Vec<ArrayOfStrings>,
bounds: Vec<Rectangle>,
text: Vec<StringIndex>,
#[serde(rename = "stackingContexts")]
stacking_contexts: RareBooleanData,
#[serde(skip_serializing_if = "Option::is_none", rename = "paintOrders")]
paint_orders: Option<Vec<i64>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "offsetRects")]
offset_rects: Option<Vec<Rectangle>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "scrollRects")]
scroll_rects: Option<Vec<Rectangle>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "clientRects")]
client_rects: Option<Vec<Rectangle>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "blendedBackgroundColors")]
blended_background_colors: Option<Vec<StringIndex>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "textColorOpacities")]
text_color_opacities: Option<Vec<f64>>,
}
impl LayoutTreeSnapshot {
pub fn builder(node_index: Vec<i64>, styles: Vec<ArrayOfStrings>, bounds: Vec<Rectangle>, text: Vec<StringIndex>, stacking_contexts: RareBooleanData) -> LayoutTreeSnapshotBuilder {
LayoutTreeSnapshotBuilder {
node_index: node_index,
styles: styles,
bounds: bounds,
text: text,
stacking_contexts: stacking_contexts,
paint_orders: None,
offset_rects: None,
scroll_rects: None,
client_rects: None,
blended_background_colors: None,
text_color_opacities: None,
}
}
pub fn node_index(&self) -> &[i64] { &self.node_index }
pub fn styles(&self) -> &[ArrayOfStrings] { &self.styles }
pub fn bounds(&self) -> &[Rectangle] { &self.bounds }
pub fn text(&self) -> &[StringIndex] { &self.text }
pub fn stacking_contexts(&self) -> &RareBooleanData { &self.stacking_contexts }
pub fn paint_orders(&self) -> Option<&[i64]> { self.paint_orders.as_deref() }
pub fn offset_rects(&self) -> Option<&[Rectangle]> { self.offset_rects.as_deref() }
pub fn scroll_rects(&self) -> Option<&[Rectangle]> { self.scroll_rects.as_deref() }
pub fn client_rects(&self) -> Option<&[Rectangle]> { self.client_rects.as_deref() }
pub fn blended_background_colors(&self) -> Option<&[StringIndex]> { self.blended_background_colors.as_deref() }
pub fn text_color_opacities(&self) -> Option<&[f64]> { self.text_color_opacities.as_deref() }
}
pub struct LayoutTreeSnapshotBuilder {
node_index: Vec<i64>,
styles: Vec<ArrayOfStrings>,
bounds: Vec<Rectangle>,
text: Vec<StringIndex>,
stacking_contexts: RareBooleanData,
paint_orders: Option<Vec<i64>>,
offset_rects: Option<Vec<Rectangle>>,
scroll_rects: Option<Vec<Rectangle>>,
client_rects: Option<Vec<Rectangle>>,
blended_background_colors: Option<Vec<StringIndex>>,
text_color_opacities: Option<Vec<f64>>,
}
impl LayoutTreeSnapshotBuilder {
pub fn paint_orders(mut self, paint_orders: Vec<i64>) -> Self { self.paint_orders = Some(paint_orders); self }
pub fn offset_rects(mut self, offset_rects: Vec<Rectangle>) -> Self { self.offset_rects = Some(offset_rects); self }
pub fn scroll_rects(mut self, scroll_rects: Vec<Rectangle>) -> Self { self.scroll_rects = Some(scroll_rects); self }
pub fn client_rects(mut self, client_rects: Vec<Rectangle>) -> Self { self.client_rects = Some(client_rects); self }
pub fn blended_background_colors(mut self, blended_background_colors: Vec<StringIndex>) -> Self { self.blended_background_colors = Some(blended_background_colors); self }
pub fn text_color_opacities(mut self, text_color_opacities: Vec<f64>) -> Self { self.text_color_opacities = Some(text_color_opacities); self }
pub fn build(self) -> LayoutTreeSnapshot {
LayoutTreeSnapshot {
node_index: self.node_index,
styles: self.styles,
bounds: self.bounds,
text: self.text,
stacking_contexts: self.stacking_contexts,
paint_orders: self.paint_orders,
offset_rects: self.offset_rects,
scroll_rects: self.scroll_rects,
client_rects: self.client_rects,
blended_background_colors: self.blended_background_colors,
text_color_opacities: self.text_color_opacities,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TextBoxSnapshot {
#[serde(rename = "layoutIndex")]
layout_index: Vec<i64>,
bounds: Vec<Rectangle>,
start: Vec<i64>,
length: Vec<i64>,
}
impl TextBoxSnapshot {
pub fn builder(layout_index: Vec<i64>, bounds: Vec<Rectangle>, start: Vec<i64>, length: Vec<i64>) -> TextBoxSnapshotBuilder {
TextBoxSnapshotBuilder {
layout_index: layout_index,
bounds: bounds,
start: start,
length: length,
}
}
pub fn layout_index(&self) -> &[i64] { &self.layout_index }
pub fn bounds(&self) -> &[Rectangle] { &self.bounds }
pub fn start(&self) -> &[i64] { &self.start }
pub fn length(&self) -> &[i64] { &self.length }
}
pub struct TextBoxSnapshotBuilder {
layout_index: Vec<i64>,
bounds: Vec<Rectangle>,
start: Vec<i64>,
length: Vec<i64>,
}
impl TextBoxSnapshotBuilder {
pub fn build(self) -> TextBoxSnapshot {
TextBoxSnapshot {
layout_index: self.layout_index,
bounds: self.bounds,
start: self.start,
length: self.length,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct DisableParams {}
impl DisableParams { pub const METHOD: &'static str = "DOMSnapshot.disable"; }
impl<'a> crate::CdpCommand<'a> for DisableParams {
const METHOD: &'static str = "DOMSnapshot.disable";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct EnableParams {}
impl EnableParams { pub const METHOD: &'static str = "DOMSnapshot.enable"; }
impl<'a> crate::CdpCommand<'a> for EnableParams {
const METHOD: &'static str = "DOMSnapshot.enable";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetSnapshotParams<'a> {
#[serde(rename = "computedStyleWhitelist")]
computed_style_whitelist: Vec<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "includeEventListeners")]
include_event_listeners: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", rename = "includePaintOrder")]
include_paint_order: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", rename = "includeUserAgentShadowTree")]
include_user_agent_shadow_tree: Option<bool>,
}
impl<'a> GetSnapshotParams<'a> {
pub fn builder(computed_style_whitelist: Vec<Cow<'a, str>>) -> GetSnapshotParamsBuilder<'a> {
GetSnapshotParamsBuilder {
computed_style_whitelist: computed_style_whitelist,
include_event_listeners: None,
include_paint_order: None,
include_user_agent_shadow_tree: None,
}
}
pub fn computed_style_whitelist(&self) -> &[Cow<'a, str>] { &self.computed_style_whitelist }
pub fn include_event_listeners(&self) -> Option<bool> { self.include_event_listeners }
pub fn include_paint_order(&self) -> Option<bool> { self.include_paint_order }
pub fn include_user_agent_shadow_tree(&self) -> Option<bool> { self.include_user_agent_shadow_tree }
}
pub struct GetSnapshotParamsBuilder<'a> {
computed_style_whitelist: Vec<Cow<'a, str>>,
include_event_listeners: Option<bool>,
include_paint_order: Option<bool>,
include_user_agent_shadow_tree: Option<bool>,
}
impl<'a> GetSnapshotParamsBuilder<'a> {
pub fn include_event_listeners(mut self, include_event_listeners: bool) -> Self { self.include_event_listeners = Some(include_event_listeners); self }
pub fn include_paint_order(mut self, include_paint_order: bool) -> Self { self.include_paint_order = Some(include_paint_order); self }
pub fn include_user_agent_shadow_tree(mut self, include_user_agent_shadow_tree: bool) -> Self { self.include_user_agent_shadow_tree = Some(include_user_agent_shadow_tree); self }
pub fn build(self) -> GetSnapshotParams<'a> {
GetSnapshotParams {
computed_style_whitelist: self.computed_style_whitelist,
include_event_listeners: self.include_event_listeners,
include_paint_order: self.include_paint_order,
include_user_agent_shadow_tree: self.include_user_agent_shadow_tree,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetSnapshotReturns<'a> {
#[serde(rename = "domNodes")]
dom_nodes: Vec<DOMNode<'a>>,
#[serde(rename = "layoutTreeNodes")]
layout_tree_nodes: Vec<LayoutTreeNode<'a>>,
#[serde(rename = "computedStyles")]
computed_styles: Vec<ComputedStyle<'a>>,
}
impl<'a> GetSnapshotReturns<'a> {
pub fn builder(dom_nodes: Vec<DOMNode<'a>>, layout_tree_nodes: Vec<LayoutTreeNode<'a>>, computed_styles: Vec<ComputedStyle<'a>>) -> GetSnapshotReturnsBuilder<'a> {
GetSnapshotReturnsBuilder {
dom_nodes: dom_nodes,
layout_tree_nodes: layout_tree_nodes,
computed_styles: computed_styles,
}
}
pub fn dom_nodes(&self) -> &[DOMNode<'a>] { &self.dom_nodes }
pub fn layout_tree_nodes(&self) -> &[LayoutTreeNode<'a>] { &self.layout_tree_nodes }
pub fn computed_styles(&self) -> &[ComputedStyle<'a>] { &self.computed_styles }
}
pub struct GetSnapshotReturnsBuilder<'a> {
dom_nodes: Vec<DOMNode<'a>>,
layout_tree_nodes: Vec<LayoutTreeNode<'a>>,
computed_styles: Vec<ComputedStyle<'a>>,
}
impl<'a> GetSnapshotReturnsBuilder<'a> {
pub fn build(self) -> GetSnapshotReturns<'a> {
GetSnapshotReturns {
dom_nodes: self.dom_nodes,
layout_tree_nodes: self.layout_tree_nodes,
computed_styles: self.computed_styles,
}
}
}
impl<'a> GetSnapshotParams<'a> { pub const METHOD: &'static str = "DOMSnapshot.getSnapshot"; }
impl<'a> crate::CdpCommand<'a> for GetSnapshotParams<'a> {
const METHOD: &'static str = "DOMSnapshot.getSnapshot";
type Response = GetSnapshotReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CaptureSnapshotParams<'a> {
#[serde(rename = "computedStyles")]
computed_styles: Vec<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none", rename = "includePaintOrder")]
include_paint_order: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", rename = "includeDOMRects")]
include_dom_rects: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", rename = "includeBlendedBackgroundColors")]
include_blended_background_colors: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", rename = "includeTextColorOpacities")]
include_text_color_opacities: Option<bool>,
}
impl<'a> CaptureSnapshotParams<'a> {
pub fn builder(computed_styles: Vec<Cow<'a, str>>) -> CaptureSnapshotParamsBuilder<'a> {
CaptureSnapshotParamsBuilder {
computed_styles: computed_styles,
include_paint_order: None,
include_dom_rects: None,
include_blended_background_colors: None,
include_text_color_opacities: None,
}
}
pub fn computed_styles(&self) -> &[Cow<'a, str>] { &self.computed_styles }
pub fn include_paint_order(&self) -> Option<bool> { self.include_paint_order }
pub fn include_dom_rects(&self) -> Option<bool> { self.include_dom_rects }
pub fn include_blended_background_colors(&self) -> Option<bool> { self.include_blended_background_colors }
pub fn include_text_color_opacities(&self) -> Option<bool> { self.include_text_color_opacities }
}
pub struct CaptureSnapshotParamsBuilder<'a> {
computed_styles: Vec<Cow<'a, str>>,
include_paint_order: Option<bool>,
include_dom_rects: Option<bool>,
include_blended_background_colors: Option<bool>,
include_text_color_opacities: Option<bool>,
}
impl<'a> CaptureSnapshotParamsBuilder<'a> {
pub fn include_paint_order(mut self, include_paint_order: bool) -> Self { self.include_paint_order = Some(include_paint_order); self }
pub fn include_dom_rects(mut self, include_dom_rects: bool) -> Self { self.include_dom_rects = Some(include_dom_rects); self }
pub fn include_blended_background_colors(mut self, include_blended_background_colors: bool) -> Self { self.include_blended_background_colors = Some(include_blended_background_colors); self }
pub fn include_text_color_opacities(mut self, include_text_color_opacities: bool) -> Self { self.include_text_color_opacities = Some(include_text_color_opacities); self }
pub fn build(self) -> CaptureSnapshotParams<'a> {
CaptureSnapshotParams {
computed_styles: self.computed_styles,
include_paint_order: self.include_paint_order,
include_dom_rects: self.include_dom_rects,
include_blended_background_colors: self.include_blended_background_colors,
include_text_color_opacities: self.include_text_color_opacities,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CaptureSnapshotReturns<'a> {
documents: Vec<DocumentSnapshot>,
strings: Vec<Cow<'a, str>>,
}
impl<'a> CaptureSnapshotReturns<'a> {
pub fn builder(documents: Vec<DocumentSnapshot>, strings: Vec<Cow<'a, str>>) -> CaptureSnapshotReturnsBuilder<'a> {
CaptureSnapshotReturnsBuilder {
documents: documents,
strings: strings,
}
}
pub fn documents(&self) -> &[DocumentSnapshot] { &self.documents }
pub fn strings(&self) -> &[Cow<'a, str>] { &self.strings }
}
pub struct CaptureSnapshotReturnsBuilder<'a> {
documents: Vec<DocumentSnapshot>,
strings: Vec<Cow<'a, str>>,
}
impl<'a> CaptureSnapshotReturnsBuilder<'a> {
pub fn build(self) -> CaptureSnapshotReturns<'a> {
CaptureSnapshotReturns {
documents: self.documents,
strings: self.strings,
}
}
}
impl<'a> CaptureSnapshotParams<'a> { pub const METHOD: &'static str = "DOMSnapshot.captureSnapshot"; }
impl<'a> crate::CdpCommand<'a> for CaptureSnapshotParams<'a> {
const METHOD: &'static str = "DOMSnapshot.captureSnapshot";
type Response = CaptureSnapshotReturns<'a>;
}