use serde::{Serialize, Deserialize};
use serde_json::Value as JsonValue;
use std::borrow::Cow;
pub type LayerId<'a> = Cow<'a, str>;
pub type SnapshotId<'a> = Cow<'a, str>;
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ScrollRect<'a> {
rect: crate::dom::Rect,
#[serde(rename = "type")]
type_: Cow<'a, str>,
}
impl<'a> ScrollRect<'a> {
pub fn builder(rect: crate::dom::Rect, type_: impl Into<Cow<'a, str>>) -> ScrollRectBuilder<'a> {
ScrollRectBuilder {
rect: rect,
type_: type_.into(),
}
}
pub fn rect(&self) -> &crate::dom::Rect { &self.rect }
pub fn type_(&self) -> &str { self.type_.as_ref() }
}
pub struct ScrollRectBuilder<'a> {
rect: crate::dom::Rect,
type_: Cow<'a, str>,
}
impl<'a> ScrollRectBuilder<'a> {
pub fn build(self) -> ScrollRect<'a> {
ScrollRect {
rect: self.rect,
type_: self.type_,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct StickyPositionConstraint<'a> {
stickyBoxRect: crate::dom::Rect,
containingBlockRect: crate::dom::Rect,
#[serde(skip_serializing_if = "Option::is_none")]
nearestLayerShiftingStickyBox: Option<LayerId<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
nearestLayerShiftingContainingBlock: Option<LayerId<'a>>,
}
impl<'a> StickyPositionConstraint<'a> {
pub fn builder(stickyBoxRect: crate::dom::Rect, containingBlockRect: crate::dom::Rect) -> StickyPositionConstraintBuilder<'a> {
StickyPositionConstraintBuilder {
stickyBoxRect: stickyBoxRect,
containingBlockRect: containingBlockRect,
nearestLayerShiftingStickyBox: None,
nearestLayerShiftingContainingBlock: None,
}
}
pub fn stickyBoxRect(&self) -> &crate::dom::Rect { &self.stickyBoxRect }
pub fn containingBlockRect(&self) -> &crate::dom::Rect { &self.containingBlockRect }
pub fn nearestLayerShiftingStickyBox(&self) -> Option<&LayerId<'a>> { self.nearestLayerShiftingStickyBox.as_ref() }
pub fn nearestLayerShiftingContainingBlock(&self) -> Option<&LayerId<'a>> { self.nearestLayerShiftingContainingBlock.as_ref() }
}
pub struct StickyPositionConstraintBuilder<'a> {
stickyBoxRect: crate::dom::Rect,
containingBlockRect: crate::dom::Rect,
nearestLayerShiftingStickyBox: Option<LayerId<'a>>,
nearestLayerShiftingContainingBlock: Option<LayerId<'a>>,
}
impl<'a> StickyPositionConstraintBuilder<'a> {
pub fn nearestLayerShiftingStickyBox(mut self, nearestLayerShiftingStickyBox: LayerId<'a>) -> Self { self.nearestLayerShiftingStickyBox = Some(nearestLayerShiftingStickyBox); self }
pub fn nearestLayerShiftingContainingBlock(mut self, nearestLayerShiftingContainingBlock: LayerId<'a>) -> Self { self.nearestLayerShiftingContainingBlock = Some(nearestLayerShiftingContainingBlock); self }
pub fn build(self) -> StickyPositionConstraint<'a> {
StickyPositionConstraint {
stickyBoxRect: self.stickyBoxRect,
containingBlockRect: self.containingBlockRect,
nearestLayerShiftingStickyBox: self.nearestLayerShiftingStickyBox,
nearestLayerShiftingContainingBlock: self.nearestLayerShiftingContainingBlock,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct PictureTile<'a> {
x: f64,
y: f64,
picture: Cow<'a, str>,
}
impl<'a> PictureTile<'a> {
pub fn builder(x: f64, y: f64, picture: impl Into<Cow<'a, str>>) -> PictureTileBuilder<'a> {
PictureTileBuilder {
x: x,
y: y,
picture: picture.into(),
}
}
pub fn x(&self) -> f64 { self.x }
pub fn y(&self) -> f64 { self.y }
pub fn picture(&self) -> &str { self.picture.as_ref() }
}
pub struct PictureTileBuilder<'a> {
x: f64,
y: f64,
picture: Cow<'a, str>,
}
impl<'a> PictureTileBuilder<'a> {
pub fn build(self) -> PictureTile<'a> {
PictureTile {
x: self.x,
y: self.y,
picture: self.picture,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct Layer<'a> {
layerId: LayerId<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
parentLayerId: Option<LayerId<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
backendNodeId: Option<crate::dom::BackendNodeId>,
offsetX: f64,
offsetY: f64,
width: f64,
height: f64,
#[serde(skip_serializing_if = "Option::is_none")]
transform: Option<Vec<f64>>,
#[serde(skip_serializing_if = "Option::is_none")]
anchorX: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
anchorY: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
anchorZ: Option<f64>,
paintCount: u64,
drawsContent: bool,
#[serde(skip_serializing_if = "Option::is_none")]
invisible: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
scrollRects: Option<Vec<ScrollRect<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
stickyPositionConstraint: Option<StickyPositionConstraint<'a>>,
}
impl<'a> Layer<'a> {
pub fn builder(layerId: LayerId<'a>, offsetX: f64, offsetY: f64, width: f64, height: f64, paintCount: u64, drawsContent: bool) -> LayerBuilder<'a> {
LayerBuilder {
layerId: layerId,
parentLayerId: None,
backendNodeId: None,
offsetX: offsetX,
offsetY: offsetY,
width: width,
height: height,
transform: None,
anchorX: None,
anchorY: None,
anchorZ: None,
paintCount: paintCount,
drawsContent: drawsContent,
invisible: None,
scrollRects: None,
stickyPositionConstraint: None,
}
}
pub fn layerId(&self) -> &LayerId<'a> { &self.layerId }
pub fn parentLayerId(&self) -> Option<&LayerId<'a>> { self.parentLayerId.as_ref() }
pub fn backendNodeId(&self) -> Option<&crate::dom::BackendNodeId> { self.backendNodeId.as_ref() }
pub fn offsetX(&self) -> f64 { self.offsetX }
pub fn offsetY(&self) -> f64 { self.offsetY }
pub fn width(&self) -> f64 { self.width }
pub fn height(&self) -> f64 { self.height }
pub fn transform(&self) -> Option<&[f64]> { self.transform.as_deref() }
pub fn anchorX(&self) -> Option<f64> { self.anchorX }
pub fn anchorY(&self) -> Option<f64> { self.anchorY }
pub fn anchorZ(&self) -> Option<f64> { self.anchorZ }
pub fn paintCount(&self) -> u64 { self.paintCount }
pub fn drawsContent(&self) -> bool { self.drawsContent }
pub fn invisible(&self) -> Option<bool> { self.invisible }
pub fn scrollRects(&self) -> Option<&[ScrollRect<'a>]> { self.scrollRects.as_deref() }
pub fn stickyPositionConstraint(&self) -> Option<&StickyPositionConstraint<'a>> { self.stickyPositionConstraint.as_ref() }
}
pub struct LayerBuilder<'a> {
layerId: LayerId<'a>,
parentLayerId: Option<LayerId<'a>>,
backendNodeId: Option<crate::dom::BackendNodeId>,
offsetX: f64,
offsetY: f64,
width: f64,
height: f64,
transform: Option<Vec<f64>>,
anchorX: Option<f64>,
anchorY: Option<f64>,
anchorZ: Option<f64>,
paintCount: u64,
drawsContent: bool,
invisible: Option<bool>,
scrollRects: Option<Vec<ScrollRect<'a>>>,
stickyPositionConstraint: Option<StickyPositionConstraint<'a>>,
}
impl<'a> LayerBuilder<'a> {
pub fn parentLayerId(mut self, parentLayerId: LayerId<'a>) -> Self { self.parentLayerId = Some(parentLayerId); self }
pub fn backendNodeId(mut self, backendNodeId: crate::dom::BackendNodeId) -> Self { self.backendNodeId = Some(backendNodeId); self }
pub fn transform(mut self, transform: Vec<f64>) -> Self { self.transform = Some(transform); self }
pub fn anchorX(mut self, anchorX: f64) -> Self { self.anchorX = Some(anchorX); self }
pub fn anchorY(mut self, anchorY: f64) -> Self { self.anchorY = Some(anchorY); self }
pub fn anchorZ(mut self, anchorZ: f64) -> Self { self.anchorZ = Some(anchorZ); self }
pub fn invisible(mut self, invisible: bool) -> Self { self.invisible = Some(invisible); self }
pub fn scrollRects(mut self, scrollRects: Vec<ScrollRect<'a>>) -> Self { self.scrollRects = Some(scrollRects); self }
pub fn stickyPositionConstraint(mut self, stickyPositionConstraint: StickyPositionConstraint<'a>) -> Self { self.stickyPositionConstraint = Some(stickyPositionConstraint); self }
pub fn build(self) -> Layer<'a> {
Layer {
layerId: self.layerId,
parentLayerId: self.parentLayerId,
backendNodeId: self.backendNodeId,
offsetX: self.offsetX,
offsetY: self.offsetY,
width: self.width,
height: self.height,
transform: self.transform,
anchorX: self.anchorX,
anchorY: self.anchorY,
anchorZ: self.anchorZ,
paintCount: self.paintCount,
drawsContent: self.drawsContent,
invisible: self.invisible,
scrollRects: self.scrollRects,
stickyPositionConstraint: self.stickyPositionConstraint,
}
}
}
pub type PaintProfile = Vec<f64>;
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CompositingReasonsParams<'a> {
layerId: LayerId<'a>,
}
impl<'a> CompositingReasonsParams<'a> {
pub fn builder(layerId: LayerId<'a>) -> CompositingReasonsParamsBuilder<'a> {
CompositingReasonsParamsBuilder {
layerId: layerId,
}
}
pub fn layerId(&self) -> &LayerId<'a> { &self.layerId }
}
pub struct CompositingReasonsParamsBuilder<'a> {
layerId: LayerId<'a>,
}
impl<'a> CompositingReasonsParamsBuilder<'a> {
pub fn build(self) -> CompositingReasonsParams<'a> {
CompositingReasonsParams {
layerId: self.layerId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CompositingReasonsReturns<'a> {
compositingReasons: Vec<Cow<'a, str>>,
compositingReasonIds: Vec<Cow<'a, str>>,
}
impl<'a> CompositingReasonsReturns<'a> {
pub fn builder(compositingReasons: Vec<Cow<'a, str>>, compositingReasonIds: Vec<Cow<'a, str>>) -> CompositingReasonsReturnsBuilder<'a> {
CompositingReasonsReturnsBuilder {
compositingReasons: compositingReasons,
compositingReasonIds: compositingReasonIds,
}
}
pub fn compositingReasons(&self) -> &[Cow<'a, str>] { &self.compositingReasons }
pub fn compositingReasonIds(&self) -> &[Cow<'a, str>] { &self.compositingReasonIds }
}
pub struct CompositingReasonsReturnsBuilder<'a> {
compositingReasons: Vec<Cow<'a, str>>,
compositingReasonIds: Vec<Cow<'a, str>>,
}
impl<'a> CompositingReasonsReturnsBuilder<'a> {
pub fn build(self) -> CompositingReasonsReturns<'a> {
CompositingReasonsReturns {
compositingReasons: self.compositingReasons,
compositingReasonIds: self.compositingReasonIds,
}
}
}
impl<'a> CompositingReasonsParams<'a> { pub const METHOD: &'static str = "LayerTree.compositingReasons"; }
impl<'a> crate::CdpCommand<'a> for CompositingReasonsParams<'a> {
const METHOD: &'static str = "LayerTree.compositingReasons";
type Response = CompositingReasonsReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct DisableParams {}
impl DisableParams { pub const METHOD: &'static str = "LayerTree.disable"; }
impl<'a> crate::CdpCommand<'a> for DisableParams {
const METHOD: &'static str = "LayerTree.disable";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct EnableParams {}
impl EnableParams { pub const METHOD: &'static str = "LayerTree.enable"; }
impl<'a> crate::CdpCommand<'a> for EnableParams {
const METHOD: &'static str = "LayerTree.enable";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct LoadSnapshotParams<'a> {
tiles: Vec<PictureTile<'a>>,
}
impl<'a> LoadSnapshotParams<'a> {
pub fn builder(tiles: Vec<PictureTile<'a>>) -> LoadSnapshotParamsBuilder<'a> {
LoadSnapshotParamsBuilder {
tiles: tiles,
}
}
pub fn tiles(&self) -> &[PictureTile<'a>] { &self.tiles }
}
pub struct LoadSnapshotParamsBuilder<'a> {
tiles: Vec<PictureTile<'a>>,
}
impl<'a> LoadSnapshotParamsBuilder<'a> {
pub fn build(self) -> LoadSnapshotParams<'a> {
LoadSnapshotParams {
tiles: self.tiles,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct LoadSnapshotReturns<'a> {
snapshotId: SnapshotId<'a>,
}
impl<'a> LoadSnapshotReturns<'a> {
pub fn builder(snapshotId: SnapshotId<'a>) -> LoadSnapshotReturnsBuilder<'a> {
LoadSnapshotReturnsBuilder {
snapshotId: snapshotId,
}
}
pub fn snapshotId(&self) -> &SnapshotId<'a> { &self.snapshotId }
}
pub struct LoadSnapshotReturnsBuilder<'a> {
snapshotId: SnapshotId<'a>,
}
impl<'a> LoadSnapshotReturnsBuilder<'a> {
pub fn build(self) -> LoadSnapshotReturns<'a> {
LoadSnapshotReturns {
snapshotId: self.snapshotId,
}
}
}
impl<'a> LoadSnapshotParams<'a> { pub const METHOD: &'static str = "LayerTree.loadSnapshot"; }
impl<'a> crate::CdpCommand<'a> for LoadSnapshotParams<'a> {
const METHOD: &'static str = "LayerTree.loadSnapshot";
type Response = LoadSnapshotReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct MakeSnapshotParams<'a> {
layerId: LayerId<'a>,
}
impl<'a> MakeSnapshotParams<'a> {
pub fn builder(layerId: LayerId<'a>) -> MakeSnapshotParamsBuilder<'a> {
MakeSnapshotParamsBuilder {
layerId: layerId,
}
}
pub fn layerId(&self) -> &LayerId<'a> { &self.layerId }
}
pub struct MakeSnapshotParamsBuilder<'a> {
layerId: LayerId<'a>,
}
impl<'a> MakeSnapshotParamsBuilder<'a> {
pub fn build(self) -> MakeSnapshotParams<'a> {
MakeSnapshotParams {
layerId: self.layerId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct MakeSnapshotReturns<'a> {
snapshotId: SnapshotId<'a>,
}
impl<'a> MakeSnapshotReturns<'a> {
pub fn builder(snapshotId: SnapshotId<'a>) -> MakeSnapshotReturnsBuilder<'a> {
MakeSnapshotReturnsBuilder {
snapshotId: snapshotId,
}
}
pub fn snapshotId(&self) -> &SnapshotId<'a> { &self.snapshotId }
}
pub struct MakeSnapshotReturnsBuilder<'a> {
snapshotId: SnapshotId<'a>,
}
impl<'a> MakeSnapshotReturnsBuilder<'a> {
pub fn build(self) -> MakeSnapshotReturns<'a> {
MakeSnapshotReturns {
snapshotId: self.snapshotId,
}
}
}
impl<'a> MakeSnapshotParams<'a> { pub const METHOD: &'static str = "LayerTree.makeSnapshot"; }
impl<'a> crate::CdpCommand<'a> for MakeSnapshotParams<'a> {
const METHOD: &'static str = "LayerTree.makeSnapshot";
type Response = MakeSnapshotReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ProfileSnapshotParams<'a> {
snapshotId: SnapshotId<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
minRepeatCount: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
minDuration: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
clipRect: Option<crate::dom::Rect>,
}
impl<'a> ProfileSnapshotParams<'a> {
pub fn builder(snapshotId: SnapshotId<'a>) -> ProfileSnapshotParamsBuilder<'a> {
ProfileSnapshotParamsBuilder {
snapshotId: snapshotId,
minRepeatCount: None,
minDuration: None,
clipRect: None,
}
}
pub fn snapshotId(&self) -> &SnapshotId<'a> { &self.snapshotId }
pub fn minRepeatCount(&self) -> Option<u64> { self.minRepeatCount }
pub fn minDuration(&self) -> Option<f64> { self.minDuration }
pub fn clipRect(&self) -> Option<&crate::dom::Rect> { self.clipRect.as_ref() }
}
pub struct ProfileSnapshotParamsBuilder<'a> {
snapshotId: SnapshotId<'a>,
minRepeatCount: Option<u64>,
minDuration: Option<f64>,
clipRect: Option<crate::dom::Rect>,
}
impl<'a> ProfileSnapshotParamsBuilder<'a> {
pub fn minRepeatCount(mut self, minRepeatCount: u64) -> Self { self.minRepeatCount = Some(minRepeatCount); self }
pub fn minDuration(mut self, minDuration: f64) -> Self { self.minDuration = Some(minDuration); self }
pub fn clipRect(mut self, clipRect: crate::dom::Rect) -> Self { self.clipRect = Some(clipRect); self }
pub fn build(self) -> ProfileSnapshotParams<'a> {
ProfileSnapshotParams {
snapshotId: self.snapshotId,
minRepeatCount: self.minRepeatCount,
minDuration: self.minDuration,
clipRect: self.clipRect,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ProfileSnapshotReturns {
timings: Vec<PaintProfile>,
}
impl ProfileSnapshotReturns {
pub fn builder(timings: Vec<PaintProfile>) -> ProfileSnapshotReturnsBuilder {
ProfileSnapshotReturnsBuilder {
timings: timings,
}
}
pub fn timings(&self) -> &[PaintProfile] { &self.timings }
}
pub struct ProfileSnapshotReturnsBuilder {
timings: Vec<PaintProfile>,
}
impl ProfileSnapshotReturnsBuilder {
pub fn build(self) -> ProfileSnapshotReturns {
ProfileSnapshotReturns {
timings: self.timings,
}
}
}
impl<'a> ProfileSnapshotParams<'a> { pub const METHOD: &'static str = "LayerTree.profileSnapshot"; }
impl<'a> crate::CdpCommand<'a> for ProfileSnapshotParams<'a> {
const METHOD: &'static str = "LayerTree.profileSnapshot";
type Response = ProfileSnapshotReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ReleaseSnapshotParams<'a> {
snapshotId: SnapshotId<'a>,
}
impl<'a> ReleaseSnapshotParams<'a> {
pub fn builder(snapshotId: SnapshotId<'a>) -> ReleaseSnapshotParamsBuilder<'a> {
ReleaseSnapshotParamsBuilder {
snapshotId: snapshotId,
}
}
pub fn snapshotId(&self) -> &SnapshotId<'a> { &self.snapshotId }
}
pub struct ReleaseSnapshotParamsBuilder<'a> {
snapshotId: SnapshotId<'a>,
}
impl<'a> ReleaseSnapshotParamsBuilder<'a> {
pub fn build(self) -> ReleaseSnapshotParams<'a> {
ReleaseSnapshotParams {
snapshotId: self.snapshotId,
}
}
}
impl<'a> ReleaseSnapshotParams<'a> { pub const METHOD: &'static str = "LayerTree.releaseSnapshot"; }
impl<'a> crate::CdpCommand<'a> for ReleaseSnapshotParams<'a> {
const METHOD: &'static str = "LayerTree.releaseSnapshot";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ReplaySnapshotParams<'a> {
snapshotId: SnapshotId<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
fromStep: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
toStep: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
scale: Option<f64>,
}
impl<'a> ReplaySnapshotParams<'a> {
pub fn builder(snapshotId: SnapshotId<'a>) -> ReplaySnapshotParamsBuilder<'a> {
ReplaySnapshotParamsBuilder {
snapshotId: snapshotId,
fromStep: None,
toStep: None,
scale: None,
}
}
pub fn snapshotId(&self) -> &SnapshotId<'a> { &self.snapshotId }
pub fn fromStep(&self) -> Option<i64> { self.fromStep }
pub fn toStep(&self) -> Option<i64> { self.toStep }
pub fn scale(&self) -> Option<f64> { self.scale }
}
pub struct ReplaySnapshotParamsBuilder<'a> {
snapshotId: SnapshotId<'a>,
fromStep: Option<i64>,
toStep: Option<i64>,
scale: Option<f64>,
}
impl<'a> ReplaySnapshotParamsBuilder<'a> {
pub fn fromStep(mut self, fromStep: i64) -> Self { self.fromStep = Some(fromStep); self }
pub fn toStep(mut self, toStep: i64) -> Self { self.toStep = Some(toStep); self }
pub fn scale(mut self, scale: f64) -> Self { self.scale = Some(scale); self }
pub fn build(self) -> ReplaySnapshotParams<'a> {
ReplaySnapshotParams {
snapshotId: self.snapshotId,
fromStep: self.fromStep,
toStep: self.toStep,
scale: self.scale,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ReplaySnapshotReturns<'a> {
dataURL: Cow<'a, str>,
}
impl<'a> ReplaySnapshotReturns<'a> {
pub fn builder(dataURL: impl Into<Cow<'a, str>>) -> ReplaySnapshotReturnsBuilder<'a> {
ReplaySnapshotReturnsBuilder {
dataURL: dataURL.into(),
}
}
pub fn dataURL(&self) -> &str { self.dataURL.as_ref() }
}
pub struct ReplaySnapshotReturnsBuilder<'a> {
dataURL: Cow<'a, str>,
}
impl<'a> ReplaySnapshotReturnsBuilder<'a> {
pub fn build(self) -> ReplaySnapshotReturns<'a> {
ReplaySnapshotReturns {
dataURL: self.dataURL,
}
}
}
impl<'a> ReplaySnapshotParams<'a> { pub const METHOD: &'static str = "LayerTree.replaySnapshot"; }
impl<'a> crate::CdpCommand<'a> for ReplaySnapshotParams<'a> {
const METHOD: &'static str = "LayerTree.replaySnapshot";
type Response = ReplaySnapshotReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SnapshotCommandLogParams<'a> {
snapshotId: SnapshotId<'a>,
}
impl<'a> SnapshotCommandLogParams<'a> {
pub fn builder(snapshotId: SnapshotId<'a>) -> SnapshotCommandLogParamsBuilder<'a> {
SnapshotCommandLogParamsBuilder {
snapshotId: snapshotId,
}
}
pub fn snapshotId(&self) -> &SnapshotId<'a> { &self.snapshotId }
}
pub struct SnapshotCommandLogParamsBuilder<'a> {
snapshotId: SnapshotId<'a>,
}
impl<'a> SnapshotCommandLogParamsBuilder<'a> {
pub fn build(self) -> SnapshotCommandLogParams<'a> {
SnapshotCommandLogParams {
snapshotId: self.snapshotId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SnapshotCommandLogReturns {
commandLog: Vec<serde_json::Map<String, JsonValue>>,
}
impl SnapshotCommandLogReturns {
pub fn builder(commandLog: Vec<serde_json::Map<String, JsonValue>>) -> SnapshotCommandLogReturnsBuilder {
SnapshotCommandLogReturnsBuilder {
commandLog: commandLog,
}
}
pub fn commandLog(&self) -> &[serde_json::Map<String, JsonValue>] { &self.commandLog }
}
pub struct SnapshotCommandLogReturnsBuilder {
commandLog: Vec<serde_json::Map<String, JsonValue>>,
}
impl SnapshotCommandLogReturnsBuilder {
pub fn build(self) -> SnapshotCommandLogReturns {
SnapshotCommandLogReturns {
commandLog: self.commandLog,
}
}
}
impl<'a> SnapshotCommandLogParams<'a> { pub const METHOD: &'static str = "LayerTree.snapshotCommandLog"; }
impl<'a> crate::CdpCommand<'a> for SnapshotCommandLogParams<'a> {
const METHOD: &'static str = "LayerTree.snapshotCommandLog";
type Response = SnapshotCommandLogReturns;
}