cdp_protocol/
headless_experimental.rs1#[allow(unused_imports)]
3use super::types::*;
4#[allow(unused_imports)]
5use serde::{Deserialize, Serialize};
6#[allow(unused_imports)]
7use serde_json::Value as Json;
8#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
9pub enum ScreenshotParamsFormat {
10 #[serde(rename = "jpeg")]
11 Jpeg,
12 #[serde(rename = "png")]
13 Png,
14 #[serde(rename = "webp")]
15 Webp,
16}
17#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
18pub struct ScreenshotParams {
19 #[serde(skip_serializing_if = "Option::is_none")]
20 #[serde(rename = "format")]
21 pub format: Option<ScreenshotParamsFormat>,
22 #[serde(skip_serializing_if = "Option::is_none")]
23 #[serde(default)]
24 #[serde(rename = "quality")]
25 pub quality: Option<JsUInt>,
26 #[serde(skip_serializing_if = "Option::is_none")]
27 #[serde(default)]
28 #[serde(rename = "optimizeForSpeed")]
29 pub optimize_for_speed: Option<bool>,
30}
31#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
32pub struct BeginFrame {
33 #[serde(skip_serializing_if = "Option::is_none")]
34 #[serde(default)]
35 #[serde(rename = "frameTimeTicks")]
36 pub frame_time_ticks: Option<JsFloat>,
37 #[serde(skip_serializing_if = "Option::is_none")]
38 #[serde(default)]
39 #[serde(rename = "interval")]
40 pub interval: Option<JsFloat>,
41 #[serde(skip_serializing_if = "Option::is_none")]
42 #[serde(default)]
43 #[serde(rename = "noDisplayUpdates")]
44 pub no_display_updates: Option<bool>,
45 #[serde(skip_serializing_if = "Option::is_none")]
46 #[serde(rename = "screenshot")]
47 pub screenshot: Option<ScreenshotParams>,
48}
49#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
50#[serde(rename_all = "camelCase")]
51pub struct Disable(pub Option<serde_json::Value>);
52#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
53#[serde(rename_all = "camelCase")]
54pub struct Enable(pub Option<serde_json::Value>);
55#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
56pub struct BeginFrameReturnObject {
57 #[serde(default)]
58 #[serde(rename = "hasDamage")]
59 pub has_damage: bool,
60 #[serde(skip_serializing_if = "Option::is_none")]
61 #[serde(rename = "screenshotData")]
62 pub screenshot_data: Option<Vec<u8>>,
63}
64#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
65#[serde(rename_all = "camelCase")]
66pub struct DisableReturnObject {}
67#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
68#[serde(rename_all = "camelCase")]
69pub struct EnableReturnObject {}
70impl Method for BeginFrame {
71 const NAME: &'static str = "HeadlessExperimental.beginFrame";
72 type ReturnObject = BeginFrameReturnObject;
73}
74impl Method for Disable {
75 const NAME: &'static str = "HeadlessExperimental.disable";
76 type ReturnObject = DisableReturnObject;
77}
78impl Method for Enable {
79 const NAME: &'static str = "HeadlessExperimental.enable";
80 type ReturnObject = EnableReturnObject;
81}
82pub mod events {
83 #[allow(unused_imports)]
84 use super::super::types::*;
85 #[allow(unused_imports)]
86 use serde::{Deserialize, Serialize};
87}