Skip to main content

rustenium_cdp_definitions/browser_protocol/headless_experimental/
results.rs

1use serde::{Deserialize, Serialize};
2#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3pub struct BeginFrameResult {
4    #[doc = "Whether the BeginFrame resulted in damage and, thus, a new frame was committed to the\ndisplay. Reported for diagnostic uses, may be removed in the future."]
5    #[serde(rename = "hasDamage")]
6    pub has_damage: bool,
7    #[doc = "Base64-encoded image data of the screenshot, if one was requested and successfully taken."]
8    #[serde(rename = "screenshotData")]
9    #[serde(skip_serializing_if = "Option::is_none")]
10    #[serde(default)]
11    pub screenshot_data: Option<crate::Binary>,
12}
13impl TryFrom<serde_json::Value> for BeginFrameResult {
14    type Error = serde_json::Error;
15    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
16        serde_json::from_value(value)
17    }
18}
19#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
20pub struct DisableResult {}
21impl TryFrom<serde_json::Value> for DisableResult {
22    type Error = serde_json::Error;
23    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
24        serde_json::from_value(value)
25    }
26}
27#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
28pub struct EnableResult {}
29impl TryFrom<serde_json::Value> for EnableResult {
30    type Error = serde_json::Error;
31    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
32        serde_json::from_value(value)
33    }
34}