rustenium_cdp_definitions/js_protocol/debugger/
events.rs1use serde::{Deserialize, Serialize};
2#[doc = "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.\n[paused](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-paused)"]
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct PausedParams {
5 #[doc = "Call stack the virtual machine stopped on."]
6 #[serde(rename = "callFrames")]
7 #[serde(skip_serializing_if = "Vec::is_empty")]
8 pub call_frames: Vec<super::types::CallFrame>,
9 #[doc = "Pause reason."]
10 #[serde(rename = "reason")]
11 pub reason: PausedReason,
12 #[doc = "Object containing break-specific auxiliary properties."]
13 #[serde(rename = "data")]
14 #[serde(skip_serializing_if = "Option::is_none")]
15 #[serde(default)]
16 pub data: Option<serde_json::Value>,
17 #[doc = "Hit breakpoints IDs"]
18 #[serde(rename = "hitBreakpoints")]
19 #[serde(skip_serializing_if = "Option::is_none")]
20 #[serde(default)]
21 pub hit_breakpoints: Option<Vec<String>>,
22 #[doc = "Async stack trace, if any."]
23 #[serde(rename = "asyncStackTrace")]
24 #[serde(skip_serializing_if = "Option::is_none")]
25 #[serde(default)]
26 pub async_stack_trace: Option<crate::js_protocol::runtime::types::StackTrace>,
27 #[doc = "Async stack trace, if any."]
28 #[serde(rename = "asyncStackTraceId")]
29 #[serde(skip_serializing_if = "Option::is_none")]
30 #[serde(default)]
31 pub async_stack_trace_id: Option<crate::js_protocol::runtime::types::StackTraceId>,
32}
33#[doc = "Pause reason."]
34#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
35pub enum PausedReason {
36 #[serde(rename = "ambiguous")]
37 Ambiguous,
38 #[serde(rename = "assert")]
39 Assert,
40 #[serde(rename = "CSPViolation")]
41 CspViolation,
42 #[serde(rename = "debugCommand")]
43 DebugCommand,
44 #[serde(rename = "DOM")]
45 Dom,
46 #[serde(rename = "EventListener")]
47 EventListener,
48 #[serde(rename = "exception")]
49 Exception,
50 #[serde(rename = "instrumentation")]
51 Instrumentation,
52 #[serde(rename = "OOM")]
53 Oom,
54 #[serde(rename = "other")]
55 Other,
56 #[serde(rename = "promiseRejection")]
57 PromiseRejection,
58 #[serde(rename = "XHR")]
59 Xhr,
60 #[serde(rename = "step")]
61 Step,
62}
63#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
64pub enum PausedMethod {
65 #[serde(rename = "Debugger.paused")]
66 Paused,
67}
68#[doc = "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.\n[paused](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-paused)"]
69#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
70pub struct Paused {
71 pub method: PausedMethod,
72 pub params: PausedParams,
73}
74impl Paused {
75 pub const IDENTIFIER: &'static str = "Debugger.paused";
76 pub fn identifier(&self) -> &'static str {
77 Self::IDENTIFIER
78 }
79}
80#[doc = "Fired when the virtual machine resumed execution.\n[resumed](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-resumed)"]
81#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
82pub struct ResumedParams {}
83#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
84pub enum ResumedMethod {
85 #[serde(rename = "Debugger.resumed")]
86 Resumed,
87}
88#[doc = "Fired when the virtual machine resumed execution.\n[resumed](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-resumed)"]
89#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
90pub struct Resumed {
91 pub method: ResumedMethod,
92 pub params: ResumedParams,
93}
94impl Resumed {
95 pub const IDENTIFIER: &'static str = "Debugger.resumed";
96 pub fn identifier(&self) -> &'static str {
97 Self::IDENTIFIER
98 }
99}
100#[doc = "Fired when virtual machine fails to parse the script.\n[scriptFailedToParse](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-scriptFailedToParse)"]
101#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
102pub struct ScriptFailedToParseParams {
103 #[doc = "Identifier of the script parsed."]
104 #[serde(rename = "scriptId")]
105 pub script_id: crate::js_protocol::runtime::types::ScriptId,
106 #[doc = "URL or name of the script parsed (if any)."]
107 #[serde(rename = "url")]
108 pub url: String,
109 #[doc = "Line offset of the script within the resource with given URL (for script tags)."]
110 #[serde(rename = "startLine")]
111 pub start_line: i64,
112 #[doc = "Column offset of the script within the resource with given URL."]
113 #[serde(rename = "startColumn")]
114 pub start_column: i64,
115 #[doc = "Last line of the script."]
116 #[serde(rename = "endLine")]
117 pub end_line: i64,
118 #[doc = "Length of the last line of the script."]
119 #[serde(rename = "endColumn")]
120 pub end_column: i64,
121 #[doc = "Specifies script creation context."]
122 #[serde(rename = "executionContextId")]
123 pub execution_context_id: crate::js_protocol::runtime::types::ExecutionContextId,
124 #[doc = "Content hash of the script, SHA-256."]
125 #[serde(rename = "hash")]
126 pub hash: String,
127 #[doc = "For Wasm modules, the content of the `build_id` custom section. For JavaScript the `debugId` magic comment."]
128 #[serde(rename = "buildId")]
129 pub build_id: String,
130 #[doc = "Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}"]
131 #[serde(rename = "executionContextAuxData")]
132 #[serde(skip_serializing_if = "Option::is_none")]
133 #[serde(default)]
134 pub execution_context_aux_data: Option<serde_json::Value>,
135 #[doc = "URL of source map associated with script (if any)."]
136 #[serde(rename = "sourceMapURL")]
137 #[serde(skip_serializing_if = "Option::is_none")]
138 #[serde(default)]
139 pub source_map_url: Option<String>,
140 #[doc = "True, if this script has sourceURL."]
141 #[serde(rename = "hasSourceURL")]
142 #[serde(skip_serializing_if = "Option::is_none")]
143 #[serde(default)]
144 pub has_source_url: Option<bool>,
145 #[doc = "True, if this script is ES6 module."]
146 #[serde(rename = "isModule")]
147 #[serde(skip_serializing_if = "Option::is_none")]
148 #[serde(default)]
149 pub is_module: Option<bool>,
150 #[doc = "This script length."]
151 #[serde(rename = "length")]
152 #[serde(skip_serializing_if = "Option::is_none")]
153 #[serde(default)]
154 pub length: Option<i64>,
155 #[doc = "JavaScript top stack frame of where the script parsed event was triggered if available."]
156 #[serde(rename = "stackTrace")]
157 #[serde(skip_serializing_if = "Option::is_none")]
158 #[serde(default)]
159 pub stack_trace: Option<crate::js_protocol::runtime::types::StackTrace>,
160 #[doc = "If the scriptLanguage is WebAssembly, the code section offset in the module."]
161 #[serde(rename = "codeOffset")]
162 #[serde(skip_serializing_if = "Option::is_none")]
163 #[serde(default)]
164 pub code_offset: Option<i64>,
165 #[doc = "The language of the script."]
166 #[serde(rename = "scriptLanguage")]
167 #[serde(skip_serializing_if = "Option::is_none")]
168 #[serde(default)]
169 pub script_language: Option<super::types::ScriptLanguage>,
170 #[doc = "The name the embedder supplied for this script."]
171 #[serde(rename = "embedderName")]
172 #[serde(skip_serializing_if = "Option::is_none")]
173 #[serde(default)]
174 pub embedder_name: Option<String>,
175}
176#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
177pub enum ScriptFailedToParseMethod {
178 #[serde(rename = "Debugger.scriptFailedToParse")]
179 ScriptFailedToParse,
180}
181#[doc = "Fired when virtual machine fails to parse the script.\n[scriptFailedToParse](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-scriptFailedToParse)"]
182#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
183pub struct ScriptFailedToParse {
184 pub method: ScriptFailedToParseMethod,
185 pub params: ScriptFailedToParseParams,
186}
187impl ScriptFailedToParse {
188 pub const IDENTIFIER: &'static str = "Debugger.scriptFailedToParse";
189 pub fn identifier(&self) -> &'static str {
190 Self::IDENTIFIER
191 }
192}
193#[doc = "Fired when virtual machine parses script. This event is also fired for all known and uncollected\nscripts upon enabling debugger.\n[scriptParsed](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-scriptParsed)"]
194#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
195pub struct ScriptParsedParams {
196 #[doc = "Identifier of the script parsed."]
197 #[serde(rename = "scriptId")]
198 pub script_id: crate::js_protocol::runtime::types::ScriptId,
199 #[doc = "URL or name of the script parsed (if any)."]
200 #[serde(rename = "url")]
201 pub url: String,
202 #[doc = "Line offset of the script within the resource with given URL (for script tags)."]
203 #[serde(rename = "startLine")]
204 pub start_line: i64,
205 #[doc = "Column offset of the script within the resource with given URL."]
206 #[serde(rename = "startColumn")]
207 pub start_column: i64,
208 #[doc = "Last line of the script."]
209 #[serde(rename = "endLine")]
210 pub end_line: i64,
211 #[doc = "Length of the last line of the script."]
212 #[serde(rename = "endColumn")]
213 pub end_column: i64,
214 #[doc = "Specifies script creation context."]
215 #[serde(rename = "executionContextId")]
216 pub execution_context_id: crate::js_protocol::runtime::types::ExecutionContextId,
217 #[doc = "Content hash of the script, SHA-256."]
218 #[serde(rename = "hash")]
219 pub hash: String,
220 #[doc = "For Wasm modules, the content of the `build_id` custom section. For JavaScript the `debugId` magic comment."]
221 #[serde(rename = "buildId")]
222 pub build_id: String,
223 #[doc = "Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}"]
224 #[serde(rename = "executionContextAuxData")]
225 #[serde(skip_serializing_if = "Option::is_none")]
226 #[serde(default)]
227 pub execution_context_aux_data: Option<serde_json::Value>,
228 #[doc = "True, if this script is generated as a result of the live edit operation."]
229 #[serde(rename = "isLiveEdit")]
230 #[serde(skip_serializing_if = "Option::is_none")]
231 #[serde(default)]
232 pub is_live_edit: Option<bool>,
233 #[doc = "URL of source map associated with script (if any)."]
234 #[serde(rename = "sourceMapURL")]
235 #[serde(skip_serializing_if = "Option::is_none")]
236 #[serde(default)]
237 pub source_map_url: Option<String>,
238 #[doc = "True, if this script has sourceURL."]
239 #[serde(rename = "hasSourceURL")]
240 #[serde(skip_serializing_if = "Option::is_none")]
241 #[serde(default)]
242 pub has_source_url: Option<bool>,
243 #[doc = "True, if this script is ES6 module."]
244 #[serde(rename = "isModule")]
245 #[serde(skip_serializing_if = "Option::is_none")]
246 #[serde(default)]
247 pub is_module: Option<bool>,
248 #[doc = "This script length."]
249 #[serde(rename = "length")]
250 #[serde(skip_serializing_if = "Option::is_none")]
251 #[serde(default)]
252 pub length: Option<i64>,
253 #[doc = "JavaScript top stack frame of where the script parsed event was triggered if available."]
254 #[serde(rename = "stackTrace")]
255 #[serde(skip_serializing_if = "Option::is_none")]
256 #[serde(default)]
257 pub stack_trace: Option<crate::js_protocol::runtime::types::StackTrace>,
258 #[doc = "If the scriptLanguage is WebAssembly, the code section offset in the module."]
259 #[serde(rename = "codeOffset")]
260 #[serde(skip_serializing_if = "Option::is_none")]
261 #[serde(default)]
262 pub code_offset: Option<i64>,
263 #[doc = "The language of the script."]
264 #[serde(rename = "scriptLanguage")]
265 #[serde(skip_serializing_if = "Option::is_none")]
266 #[serde(default)]
267 pub script_language: Option<super::types::ScriptLanguage>,
268 #[doc = "If the scriptLanguage is WebAssembly, the source of debug symbols for the module."]
269 #[serde(rename = "debugSymbols")]
270 #[serde(skip_serializing_if = "Option::is_none")]
271 #[serde(default)]
272 pub debug_symbols: Option<Vec<super::types::DebugSymbols>>,
273 #[doc = "The name the embedder supplied for this script."]
274 #[serde(rename = "embedderName")]
275 #[serde(skip_serializing_if = "Option::is_none")]
276 #[serde(default)]
277 pub embedder_name: Option<String>,
278 #[doc = "The list of set breakpoints in this script if calls to `setBreakpointByUrl`\nmatches this script's URL or hash. Clients that use this list can ignore the\n`breakpointResolved` event. They are equivalent."]
279 #[serde(rename = "resolvedBreakpoints")]
280 #[serde(skip_serializing_if = "Option::is_none")]
281 #[serde(default)]
282 pub resolved_breakpoints: Option<Vec<super::types::ResolvedBreakpoint>>,
283}
284#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
285pub enum ScriptParsedMethod {
286 #[serde(rename = "Debugger.scriptParsed")]
287 ScriptParsed,
288}
289#[doc = "Fired when virtual machine parses script. This event is also fired for all known and uncollected\nscripts upon enabling debugger.\n[scriptParsed](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-scriptParsed)"]
290#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
291pub struct ScriptParsed {
292 pub method: ScriptParsedMethod,
293 pub params: ScriptParsedParams,
294}
295impl ScriptParsed {
296 pub const IDENTIFIER: &'static str = "Debugger.scriptParsed";
297 pub fn identifier(&self) -> &'static str {
298 Self::IDENTIFIER
299 }
300}
301group_enum ! (DebuggerEvents { Paused (Paused) , Resumed (Resumed) , ScriptFailedToParse (ScriptFailedToParse) , ScriptParsed (ScriptParsed) } + identifiable);