Skip to main content

rustenium_cdp_definitions/browser_protocol/layer_tree/
results.rs

1use serde::{Deserialize, Serialize};
2#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3pub struct CompositingReasonsResult {
4    #[doc = "A list of strings specifying reasons for the given layer to become composited."]
5    #[serde(rename = "compositingReasons")]
6    #[serde(skip_serializing_if = "Vec::is_empty")]
7    pub compositing_reasons: Vec<String>,
8    #[doc = "A list of strings specifying reason IDs for the given layer to become composited."]
9    #[serde(rename = "compositingReasonIds")]
10    #[serde(skip_serializing_if = "Vec::is_empty")]
11    pub compositing_reason_ids: Vec<String>,
12}
13impl TryFrom<serde_json::Value> for CompositingReasonsResult {
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}
35#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
36pub struct LoadSnapshotResult {
37    #[doc = "The id of the snapshot."]
38    #[serde(rename = "snapshotId")]
39    pub snapshot_id: super::types::SnapshotId,
40}
41impl TryFrom<serde_json::Value> for LoadSnapshotResult {
42    type Error = serde_json::Error;
43    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
44        serde_json::from_value(value)
45    }
46}
47#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
48pub struct MakeSnapshotResult {
49    #[doc = "The id of the layer snapshot."]
50    #[serde(rename = "snapshotId")]
51    pub snapshot_id: super::types::SnapshotId,
52}
53impl TryFrom<serde_json::Value> for MakeSnapshotResult {
54    type Error = serde_json::Error;
55    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
56        serde_json::from_value(value)
57    }
58}
59#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
60pub struct ProfileSnapshotResult {
61    #[doc = "The array of paint profiles, one per run."]
62    #[serde(rename = "timings")]
63    #[serde(skip_serializing_if = "Vec::is_empty")]
64    pub timings: Vec<super::types::PaintProfile>,
65}
66impl TryFrom<serde_json::Value> for ProfileSnapshotResult {
67    type Error = serde_json::Error;
68    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
69        serde_json::from_value(value)
70    }
71}
72#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
73pub struct ReleaseSnapshotResult {}
74impl TryFrom<serde_json::Value> for ReleaseSnapshotResult {
75    type Error = serde_json::Error;
76    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
77        serde_json::from_value(value)
78    }
79}
80#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
81pub struct ReplaySnapshotResult {
82    #[doc = "A data: URL for resulting image."]
83    #[serde(rename = "dataURL")]
84    pub data_url: String,
85}
86impl TryFrom<serde_json::Value> for ReplaySnapshotResult {
87    type Error = serde_json::Error;
88    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
89        serde_json::from_value(value)
90    }
91}
92#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
93pub struct SnapshotCommandLogResult {
94    #[doc = "The array of canvas function calls."]
95    #[serde(rename = "commandLog")]
96    #[serde(skip_serializing_if = "Vec::is_empty")]
97    pub command_log: Vec<serde_json::Value>,
98}
99impl TryFrom<serde_json::Value> for SnapshotCommandLogResult {
100    type Error = serde_json::Error;
101    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
102        serde_json::from_value(value)
103    }
104}