rustenium_cdp_definitions/js_protocol/profiler/
results.rs1use serde::{Deserialize, Serialize};
2#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3pub struct DisableResult {}
4impl TryFrom<serde_json::Value> for DisableResult {
5 type Error = serde_json::Error;
6 fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
7 serde_json::from_value(value)
8 }
9}
10#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
11pub struct EnableResult {}
12impl TryFrom<serde_json::Value> for EnableResult {
13 type Error = serde_json::Error;
14 fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
15 serde_json::from_value(value)
16 }
17}
18#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
19pub struct GetBestEffortCoverageResult {
20 #[doc = "Coverage data for the current isolate."]
21 #[serde(rename = "result")]
22 #[serde(skip_serializing_if = "Vec::is_empty")]
23 pub result: Vec<super::types::ScriptCoverage>,
24}
25impl TryFrom<serde_json::Value> for GetBestEffortCoverageResult {
26 type Error = serde_json::Error;
27 fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
28 serde_json::from_value(value)
29 }
30}
31#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
32pub struct SetSamplingIntervalResult {}
33impl TryFrom<serde_json::Value> for SetSamplingIntervalResult {
34 type Error = serde_json::Error;
35 fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
36 serde_json::from_value(value)
37 }
38}
39#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
40pub struct StartResult {}
41impl TryFrom<serde_json::Value> for StartResult {
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 StartPreciseCoverageResult {
49 #[doc = "Monotonically increasing time (in seconds) when the coverage update was taken in the backend."]
50 #[serde(rename = "timestamp")]
51 pub timestamp: f64,
52}
53impl TryFrom<serde_json::Value> for StartPreciseCoverageResult {
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 StopResult {
61 #[doc = "Recorded profile."]
62 #[serde(rename = "profile")]
63 pub profile: super::types::Profile,
64}
65impl TryFrom<serde_json::Value> for StopResult {
66 type Error = serde_json::Error;
67 fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
68 serde_json::from_value(value)
69 }
70}
71#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
72pub struct StopPreciseCoverageResult {}
73impl TryFrom<serde_json::Value> for StopPreciseCoverageResult {
74 type Error = serde_json::Error;
75 fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
76 serde_json::from_value(value)
77 }
78}
79#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
80pub struct TakePreciseCoverageResult {
81 #[doc = "Coverage data for the current isolate."]
82 #[serde(rename = "result")]
83 #[serde(skip_serializing_if = "Vec::is_empty")]
84 pub result: Vec<super::types::ScriptCoverage>,
85 #[doc = "Monotonically increasing time (in seconds) when the coverage update was taken in the backend."]
86 #[serde(rename = "timestamp")]
87 pub timestamp: f64,
88}
89impl TryFrom<serde_json::Value> for TakePreciseCoverageResult {
90 type Error = serde_json::Error;
91 fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
92 serde_json::from_value(value)
93 }
94}