Skip to main content

rustenium_cdp_definitions/js_protocol/runtime/
results.rs

1use serde::{Deserialize, Serialize};
2#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3pub struct AwaitPromiseResult {
4    #[doc = "Promise result. Will contain rejected value if promise was rejected."]
5    #[serde(rename = "result")]
6    pub result: super::types::RemoteObject,
7    #[doc = "Exception details if stack strace is available."]
8    #[serde(rename = "exceptionDetails")]
9    #[serde(skip_serializing_if = "Option::is_none")]
10    #[serde(default)]
11    pub exception_details: Option<super::types::ExceptionDetails>,
12}
13impl TryFrom<serde_json::Value> for AwaitPromiseResult {
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, Serialize, Deserialize)]
20pub struct CallFunctionOnResult {
21    #[doc = "Call result."]
22    #[serde(rename = "result")]
23    pub result: super::types::RemoteObject,
24    #[doc = "Exception details."]
25    #[serde(rename = "exceptionDetails")]
26    #[serde(skip_serializing_if = "Option::is_none")]
27    #[serde(default)]
28    pub exception_details: Option<super::types::ExceptionDetails>,
29}
30impl TryFrom<serde_json::Value> for CallFunctionOnResult {
31    type Error = serde_json::Error;
32    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
33        serde_json::from_value(value)
34    }
35}
36#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
37pub struct CompileScriptResult {
38    #[doc = "Id of the script."]
39    #[serde(rename = "scriptId")]
40    #[serde(skip_serializing_if = "Option::is_none")]
41    #[serde(default)]
42    pub script_id: Option<super::types::ScriptId>,
43    #[doc = "Exception details."]
44    #[serde(rename = "exceptionDetails")]
45    #[serde(skip_serializing_if = "Option::is_none")]
46    #[serde(default)]
47    pub exception_details: Option<super::types::ExceptionDetails>,
48}
49impl TryFrom<serde_json::Value> for CompileScriptResult {
50    type Error = serde_json::Error;
51    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
52        serde_json::from_value(value)
53    }
54}
55#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
56pub struct DisableResult {}
57impl TryFrom<serde_json::Value> for DisableResult {
58    type Error = serde_json::Error;
59    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
60        serde_json::from_value(value)
61    }
62}
63#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
64pub struct DiscardConsoleEntriesResult {}
65impl TryFrom<serde_json::Value> for DiscardConsoleEntriesResult {
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 EnableResult {}
73impl TryFrom<serde_json::Value> for EnableResult {
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 EvaluateResult {
81    #[doc = "Evaluation result."]
82    #[serde(rename = "result")]
83    pub result: super::types::RemoteObject,
84    #[doc = "Exception details."]
85    #[serde(rename = "exceptionDetails")]
86    #[serde(skip_serializing_if = "Option::is_none")]
87    #[serde(default)]
88    pub exception_details: Option<super::types::ExceptionDetails>,
89}
90impl TryFrom<serde_json::Value> for EvaluateResult {
91    type Error = serde_json::Error;
92    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
93        serde_json::from_value(value)
94    }
95}
96#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
97pub struct GetIsolateIdResult {
98    #[doc = "The isolate id."]
99    #[serde(rename = "id")]
100    pub id: String,
101}
102impl TryFrom<serde_json::Value> for GetIsolateIdResult {
103    type Error = serde_json::Error;
104    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
105        serde_json::from_value(value)
106    }
107}
108#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
109pub struct GetHeapUsageResult {
110    #[doc = "Used JavaScript heap size in bytes."]
111    #[serde(rename = "usedSize")]
112    pub used_size: f64,
113    #[doc = "Allocated JavaScript heap size in bytes."]
114    #[serde(rename = "totalSize")]
115    pub total_size: f64,
116    #[doc = "Used size in bytes in the embedder's garbage-collected heap."]
117    #[serde(rename = "embedderHeapUsedSize")]
118    pub embedder_heap_used_size: f64,
119    #[doc = "Size in bytes of backing storage for array buffers and external strings."]
120    #[serde(rename = "backingStorageSize")]
121    pub backing_storage_size: f64,
122}
123impl TryFrom<serde_json::Value> for GetHeapUsageResult {
124    type Error = serde_json::Error;
125    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
126        serde_json::from_value(value)
127    }
128}
129#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
130pub struct GetPropertiesResult {
131    #[doc = "Object properties."]
132    #[serde(rename = "result")]
133    #[serde(skip_serializing_if = "Vec::is_empty")]
134    pub result: Vec<super::types::PropertyDescriptor>,
135    #[doc = "Internal object properties (only of the element itself)."]
136    #[serde(rename = "internalProperties")]
137    #[serde(skip_serializing_if = "Option::is_none")]
138    #[serde(default)]
139    pub internal_properties: Option<Vec<super::types::InternalPropertyDescriptor>>,
140    #[doc = "Object private properties."]
141    #[serde(rename = "privateProperties")]
142    #[serde(skip_serializing_if = "Option::is_none")]
143    #[serde(default)]
144    pub private_properties: Option<Vec<super::types::PrivatePropertyDescriptor>>,
145    #[doc = "Exception details."]
146    #[serde(rename = "exceptionDetails")]
147    #[serde(skip_serializing_if = "Option::is_none")]
148    #[serde(default)]
149    pub exception_details: Option<super::types::ExceptionDetails>,
150}
151impl TryFrom<serde_json::Value> for GetPropertiesResult {
152    type Error = serde_json::Error;
153    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
154        serde_json::from_value(value)
155    }
156}
157#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
158pub struct GlobalLexicalScopeNamesResult {
159    #[serde(rename = "names")]
160    #[serde(skip_serializing_if = "Vec::is_empty")]
161    pub names: Vec<String>,
162}
163impl TryFrom<serde_json::Value> for GlobalLexicalScopeNamesResult {
164    type Error = serde_json::Error;
165    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
166        serde_json::from_value(value)
167    }
168}
169#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
170pub struct QueryObjectsResult {
171    #[doc = "Array with objects."]
172    #[serde(rename = "objects")]
173    pub objects: super::types::RemoteObject,
174}
175impl TryFrom<serde_json::Value> for QueryObjectsResult {
176    type Error = serde_json::Error;
177    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
178        serde_json::from_value(value)
179    }
180}
181#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
182pub struct ReleaseObjectResult {}
183impl TryFrom<serde_json::Value> for ReleaseObjectResult {
184    type Error = serde_json::Error;
185    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
186        serde_json::from_value(value)
187    }
188}
189#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
190pub struct ReleaseObjectGroupResult {}
191impl TryFrom<serde_json::Value> for ReleaseObjectGroupResult {
192    type Error = serde_json::Error;
193    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
194        serde_json::from_value(value)
195    }
196}
197#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
198pub struct RunIfWaitingForDebuggerResult {}
199impl TryFrom<serde_json::Value> for RunIfWaitingForDebuggerResult {
200    type Error = serde_json::Error;
201    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
202        serde_json::from_value(value)
203    }
204}
205#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
206pub struct RunScriptResult {
207    #[doc = "Run result."]
208    #[serde(rename = "result")]
209    pub result: super::types::RemoteObject,
210    #[doc = "Exception details."]
211    #[serde(rename = "exceptionDetails")]
212    #[serde(skip_serializing_if = "Option::is_none")]
213    #[serde(default)]
214    pub exception_details: Option<super::types::ExceptionDetails>,
215}
216impl TryFrom<serde_json::Value> for RunScriptResult {
217    type Error = serde_json::Error;
218    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
219        serde_json::from_value(value)
220    }
221}
222#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
223pub struct SetAsyncCallStackDepthResult {}
224impl TryFrom<serde_json::Value> for SetAsyncCallStackDepthResult {
225    type Error = serde_json::Error;
226    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
227        serde_json::from_value(value)
228    }
229}
230#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
231pub struct SetCustomObjectFormatterEnabledResult {}
232impl TryFrom<serde_json::Value> for SetCustomObjectFormatterEnabledResult {
233    type Error = serde_json::Error;
234    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
235        serde_json::from_value(value)
236    }
237}
238#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
239pub struct SetMaxCallStackSizeToCaptureResult {}
240impl TryFrom<serde_json::Value> for SetMaxCallStackSizeToCaptureResult {
241    type Error = serde_json::Error;
242    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
243        serde_json::from_value(value)
244    }
245}
246#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
247pub struct TerminateExecutionResult {}
248impl TryFrom<serde_json::Value> for TerminateExecutionResult {
249    type Error = serde_json::Error;
250    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
251        serde_json::from_value(value)
252    }
253}
254#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
255pub struct AddBindingResult {}
256impl TryFrom<serde_json::Value> for AddBindingResult {
257    type Error = serde_json::Error;
258    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
259        serde_json::from_value(value)
260    }
261}
262#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
263pub struct RemoveBindingResult {}
264impl TryFrom<serde_json::Value> for RemoveBindingResult {
265    type Error = serde_json::Error;
266    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
267        serde_json::from_value(value)
268    }
269}
270#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
271pub struct GetExceptionDetailsResult {
272    #[serde(rename = "exceptionDetails")]
273    #[serde(skip_serializing_if = "Option::is_none")]
274    #[serde(default)]
275    pub exception_details: Option<super::types::ExceptionDetails>,
276}
277impl TryFrom<serde_json::Value> for GetExceptionDetailsResult {
278    type Error = serde_json::Error;
279    fn try_from(value: serde_json::Value) -> Result<Self, Self::Error> {
280        serde_json::from_value(value)
281    }
282}