rustenium_cdp_definitions/browser_protocol/headless_experimental/
commands.rs1use serde::{Deserialize, Serialize};
2#[doc = "Sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a\nscreenshot from the resulting frame. Requires that the target was created with enabled\nBeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also\nhttps://goo.gle/chrome-headless-rendering for more background.\n[beginFrame](https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental/#method-beginFrame)"]
3#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
4pub struct BeginFrameParams {
5 #[doc = "Timestamp of this BeginFrame in Renderer TimeTicks (milliseconds of uptime). If not set,\nthe current time will be used."]
6 #[serde(rename = "frameTimeTicks")]
7 #[serde(skip_serializing_if = "Option::is_none")]
8 #[serde(default)]
9 pub frame_time_ticks: Option<f64>,
10 #[doc = "The interval between BeginFrames that is reported to the compositor, in milliseconds.\nDefaults to a 60 frames/second interval, i.e. about 16.666 milliseconds."]
11 #[serde(rename = "interval")]
12 #[serde(skip_serializing_if = "Option::is_none")]
13 #[serde(default)]
14 pub interval: Option<f64>,
15 #[doc = "Whether updates should not be committed and drawn onto the display. False by default. If\ntrue, only side effects of the BeginFrame will be run, such as layout and animations, but\nany visual updates may not be visible on the display or in screenshots."]
16 #[serde(rename = "noDisplayUpdates")]
17 #[serde(skip_serializing_if = "Option::is_none")]
18 #[serde(default)]
19 pub no_display_updates: Option<bool>,
20 #[doc = "If set, a screenshot of the frame will be captured and returned in the response. Otherwise,\nno screenshot will be captured. Note that capturing a screenshot can fail, for example,\nduring renderer initialization. In such a case, no screenshot data will be returned."]
21 #[serde(rename = "screenshot")]
22 #[serde(skip_serializing_if = "Option::is_none")]
23 #[serde(default)]
24 pub screenshot: Option<super::types::ScreenshotParams>,
25}
26#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
27pub enum BeginFrameMethod {
28 #[serde(rename = "HeadlessExperimental.beginFrame")]
29 BeginFrame,
30}
31#[doc = "Sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a\nscreenshot from the resulting frame. Requires that the target was created with enabled\nBeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also\nhttps://goo.gle/chrome-headless-rendering for more background.\n[beginFrame](https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental/#method-beginFrame)"]
32#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
33pub struct BeginFrame {
34 pub method: BeginFrameMethod,
35 pub params: BeginFrameParams,
36}
37impl BeginFrame {
38 pub const IDENTIFIER: &'static str = "HeadlessExperimental.beginFrame";
39 pub fn identifier(&self) -> &'static str {
40 Self::IDENTIFIER
41 }
42}
43impl crate::CommandResult for BeginFrame {
44 type Result = super::results::BeginFrameResult;
45}
46group_enum ! (HeadlessExperimentalCommands { BeginFrame (BeginFrame) } + identifiable);