1use serde::{Deserialize, Serialize};
2#[doc = "Continues execution until specific location is reached.\n[continueToLocation](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-continueToLocation)"]
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct ContinueToLocationParams {
5 #[doc = "Location to continue to."]
6 #[serde(rename = "location")]
7 pub location: super::types::Location,
8 #[serde(rename = "targetCallFrames")]
9 #[serde(skip_serializing_if = "Option::is_none")]
10 #[serde(default)]
11 pub target_call_frames: Option<ContinueToLocationTargetCallFrames>,
12}
13#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
14pub enum ContinueToLocationTargetCallFrames {
15 #[serde(rename = "any")]
16 Any,
17 #[serde(rename = "current")]
18 Current,
19}
20impl ContinueToLocationParams {
21 pub fn new(location: impl Into<super::types::Location>) -> Self {
22 Self {
23 location: location.into(),
24 target_call_frames: None,
25 }
26 }
27}
28#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
29pub enum ContinueToLocationMethod {
30 #[serde(rename = "Debugger.continueToLocation")]
31 ContinueToLocation,
32}
33#[doc = "Continues execution until specific location is reached.\n[continueToLocation](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-continueToLocation)"]
34#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
35pub struct ContinueToLocation {
36 pub method: ContinueToLocationMethod,
37 pub params: ContinueToLocationParams,
38}
39impl ContinueToLocation {
40 pub const IDENTIFIER: &'static str = "Debugger.continueToLocation";
41 pub fn identifier(&self) -> &'static str {
42 Self::IDENTIFIER
43 }
44}
45impl crate::CommandResult for ContinueToLocation {
46 type Result = super::results::ContinueToLocationResult;
47}
48#[doc = "Disables debugger for given page.\n[disable](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-disable)"]
49#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
50pub struct DisableParams {}
51#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
52pub enum DisableMethod {
53 #[serde(rename = "Debugger.disable")]
54 Disable,
55}
56#[doc = "Disables debugger for given page.\n[disable](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-disable)"]
57#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
58pub struct Disable {
59 pub method: DisableMethod,
60 pub params: DisableParams,
61}
62impl Disable {
63 pub const IDENTIFIER: &'static str = "Debugger.disable";
64 pub fn identifier(&self) -> &'static str {
65 Self::IDENTIFIER
66 }
67}
68impl crate::CommandResult for Disable {
69 type Result = super::results::DisableResult;
70}
71#[doc = "Enables debugger for the given page. Clients should not assume that the debugging has been\nenabled until the result for this command is received.\n[enable](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-enable)"]
72#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
73pub struct EnableParams {
74 #[doc = "The maximum size in bytes of collected scripts (not referenced by other heap objects)\nthe debugger can hold. Puts no limit if parameter is omitted."]
75 #[serde(rename = "maxScriptsCacheSize")]
76 #[serde(skip_serializing_if = "Option::is_none")]
77 #[serde(default)]
78 pub max_scripts_cache_size: Option<f64>,
79}
80#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
81pub enum EnableMethod {
82 #[serde(rename = "Debugger.enable")]
83 Enable,
84}
85#[doc = "Enables debugger for the given page. Clients should not assume that the debugging has been\nenabled until the result for this command is received.\n[enable](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-enable)"]
86#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
87pub struct Enable {
88 pub method: EnableMethod,
89 pub params: EnableParams,
90}
91impl Enable {
92 pub const IDENTIFIER: &'static str = "Debugger.enable";
93 pub fn identifier(&self) -> &'static str {
94 Self::IDENTIFIER
95 }
96}
97impl crate::CommandResult for Enable {
98 type Result = super::results::EnableResult;
99}
100#[doc = "Evaluates expression on a given call frame.\n[evaluateOnCallFrame](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-evaluateOnCallFrame)"]
101#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
102pub struct EvaluateOnCallFrameParams {
103 #[doc = "Call frame identifier to evaluate on."]
104 #[serde(rename = "callFrameId")]
105 pub call_frame_id: super::types::CallFrameId,
106 #[doc = "Expression to evaluate."]
107 #[serde(rename = "expression")]
108 pub expression: String,
109 #[doc = "String object group name to put result into (allows rapid releasing resulting object handles\nusing `releaseObjectGroup`)."]
110 #[serde(rename = "objectGroup")]
111 #[serde(skip_serializing_if = "Option::is_none")]
112 #[serde(default)]
113 pub object_group: Option<String>,
114 #[doc = "Specifies whether command line API should be available to the evaluated expression, defaults\nto false."]
115 #[serde(rename = "includeCommandLineAPI")]
116 #[serde(skip_serializing_if = "Option::is_none")]
117 #[serde(default)]
118 pub include_command_line_api: Option<bool>,
119 #[doc = "In silent mode exceptions thrown during evaluation are not reported and do not pause\nexecution. Overrides `setPauseOnException` state."]
120 #[serde(rename = "silent")]
121 #[serde(skip_serializing_if = "Option::is_none")]
122 #[serde(default)]
123 pub silent: Option<bool>,
124 #[doc = "Whether the result is expected to be a JSON object that should be sent by value."]
125 #[serde(rename = "returnByValue")]
126 #[serde(skip_serializing_if = "Option::is_none")]
127 #[serde(default)]
128 pub return_by_value: Option<bool>,
129 #[doc = "Whether preview should be generated for the result."]
130 #[serde(rename = "generatePreview")]
131 #[serde(skip_serializing_if = "Option::is_none")]
132 #[serde(default)]
133 pub generate_preview: Option<bool>,
134 #[doc = "Whether to throw an exception if side effect cannot be ruled out during evaluation."]
135 #[serde(rename = "throwOnSideEffect")]
136 #[serde(skip_serializing_if = "Option::is_none")]
137 #[serde(default)]
138 pub throw_on_side_effect: Option<bool>,
139 #[doc = "Terminate execution after timing out (number of milliseconds)."]
140 #[serde(rename = "timeout")]
141 #[serde(skip_serializing_if = "Option::is_none")]
142 #[serde(default)]
143 pub timeout: Option<crate::js_protocol::runtime::types::TimeDelta>,
144}
145impl EvaluateOnCallFrameParams {
146 pub fn new(
147 call_frame_id: impl Into<super::types::CallFrameId>,
148 expression: impl Into<String>,
149 ) -> Self {
150 Self {
151 call_frame_id: call_frame_id.into(),
152 expression: expression.into(),
153 object_group: None,
154 include_command_line_api: None,
155 silent: None,
156 return_by_value: None,
157 generate_preview: None,
158 throw_on_side_effect: None,
159 timeout: None,
160 }
161 }
162}
163#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
164pub enum EvaluateOnCallFrameMethod {
165 #[serde(rename = "Debugger.evaluateOnCallFrame")]
166 EvaluateOnCallFrame,
167}
168#[doc = "Evaluates expression on a given call frame.\n[evaluateOnCallFrame](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-evaluateOnCallFrame)"]
169#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
170pub struct EvaluateOnCallFrame {
171 pub method: EvaluateOnCallFrameMethod,
172 pub params: EvaluateOnCallFrameParams,
173}
174impl EvaluateOnCallFrame {
175 pub const IDENTIFIER: &'static str = "Debugger.evaluateOnCallFrame";
176 pub fn identifier(&self) -> &'static str {
177 Self::IDENTIFIER
178 }
179}
180impl crate::CommandResult for EvaluateOnCallFrame {
181 type Result = super::results::EvaluateOnCallFrameResult;
182}
183#[doc = "Returns possible locations for breakpoint. scriptId in start and end range locations should be\nthe same.\n[getPossibleBreakpoints](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-getPossibleBreakpoints)"]
184#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
185pub struct GetPossibleBreakpointsParams {
186 #[doc = "Start of range to search possible breakpoint locations in."]
187 #[serde(rename = "start")]
188 pub start: super::types::Location,
189 #[doc = "End of range to search possible breakpoint locations in (excluding). When not specified, end\nof scripts is used as end of range."]
190 #[serde(rename = "end")]
191 #[serde(skip_serializing_if = "Option::is_none")]
192 #[serde(default)]
193 pub end: Option<super::types::Location>,
194 #[doc = "Only consider locations which are in the same (non-nested) function as start."]
195 #[serde(rename = "restrictToFunction")]
196 #[serde(skip_serializing_if = "Option::is_none")]
197 #[serde(default)]
198 pub restrict_to_function: Option<bool>,
199}
200impl GetPossibleBreakpointsParams {
201 pub fn new(start: impl Into<super::types::Location>) -> Self {
202 Self {
203 start: start.into(),
204 end: None,
205 restrict_to_function: None,
206 }
207 }
208}
209#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
210pub enum GetPossibleBreakpointsMethod {
211 #[serde(rename = "Debugger.getPossibleBreakpoints")]
212 GetPossibleBreakpoints,
213}
214#[doc = "Returns possible locations for breakpoint. scriptId in start and end range locations should be\nthe same.\n[getPossibleBreakpoints](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-getPossibleBreakpoints)"]
215#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
216pub struct GetPossibleBreakpoints {
217 pub method: GetPossibleBreakpointsMethod,
218 pub params: GetPossibleBreakpointsParams,
219}
220impl GetPossibleBreakpoints {
221 pub const IDENTIFIER: &'static str = "Debugger.getPossibleBreakpoints";
222 pub fn identifier(&self) -> &'static str {
223 Self::IDENTIFIER
224 }
225}
226impl crate::CommandResult for GetPossibleBreakpoints {
227 type Result = super::results::GetPossibleBreakpointsResult;
228}
229#[doc = "Returns source for the script with given id.\n[getScriptSource](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-getScriptSource)"]
230#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
231pub struct GetScriptSourceParams {
232 #[doc = "Id of the script to get source for."]
233 #[serde(rename = "scriptId")]
234 pub script_id: crate::js_protocol::runtime::types::ScriptId,
235}
236impl GetScriptSourceParams {
237 pub fn new(script_id: impl Into<crate::js_protocol::runtime::types::ScriptId>) -> Self {
238 Self {
239 script_id: script_id.into(),
240 }
241 }
242}
243#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
244pub enum GetScriptSourceMethod {
245 #[serde(rename = "Debugger.getScriptSource")]
246 GetScriptSource,
247}
248#[doc = "Returns source for the script with given id.\n[getScriptSource](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-getScriptSource)"]
249#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
250pub struct GetScriptSource {
251 pub method: GetScriptSourceMethod,
252 pub params: GetScriptSourceParams,
253}
254impl GetScriptSource {
255 pub const IDENTIFIER: &'static str = "Debugger.getScriptSource";
256 pub fn identifier(&self) -> &'static str {
257 Self::IDENTIFIER
258 }
259}
260impl crate::CommandResult for GetScriptSource {
261 type Result = super::results::GetScriptSourceResult;
262}
263#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
264pub struct DisassembleWasmModuleParams {
265 #[doc = "Id of the script to disassemble"]
266 #[serde(rename = "scriptId")]
267 pub script_id: crate::js_protocol::runtime::types::ScriptId,
268}
269impl DisassembleWasmModuleParams {
270 pub fn new(script_id: impl Into<crate::js_protocol::runtime::types::ScriptId>) -> Self {
271 Self {
272 script_id: script_id.into(),
273 }
274 }
275}
276#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
277pub enum DisassembleWasmModuleMethod {
278 #[serde(rename = "Debugger.disassembleWasmModule")]
279 DisassembleWasmModule,
280}
281#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
282pub struct DisassembleWasmModule {
283 pub method: DisassembleWasmModuleMethod,
284 pub params: DisassembleWasmModuleParams,
285}
286impl DisassembleWasmModule {
287 pub const IDENTIFIER: &'static str = "Debugger.disassembleWasmModule";
288 pub fn identifier(&self) -> &'static str {
289 Self::IDENTIFIER
290 }
291}
292impl crate::CommandResult for DisassembleWasmModule {
293 type Result = super::results::DisassembleWasmModuleResult;
294}
295#[doc = "Disassemble the next chunk of lines for the module corresponding to the\nstream. If disassembly is complete, this API will invalidate the streamId\nand return an empty chunk. Any subsequent calls for the now invalid stream\nwill return errors.\n[nextWasmDisassemblyChunk](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-nextWasmDisassemblyChunk)"]
296#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
297pub struct NextWasmDisassemblyChunkParams {
298 #[serde(rename = "streamId")]
299 pub stream_id: String,
300}
301impl NextWasmDisassemblyChunkParams {
302 pub fn new(stream_id: impl Into<String>) -> Self {
303 Self {
304 stream_id: stream_id.into(),
305 }
306 }
307}
308impl<T: Into<String>> From<T> for NextWasmDisassemblyChunkParams {
309 fn from(url: T) -> Self {
310 NextWasmDisassemblyChunkParams::new(url)
311 }
312}
313#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
314pub enum NextWasmDisassemblyChunkMethod {
315 #[serde(rename = "Debugger.nextWasmDisassemblyChunk")]
316 NextWasmDisassemblyChunk,
317}
318#[doc = "Disassemble the next chunk of lines for the module corresponding to the\nstream. If disassembly is complete, this API will invalidate the streamId\nand return an empty chunk. Any subsequent calls for the now invalid stream\nwill return errors.\n[nextWasmDisassemblyChunk](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-nextWasmDisassemblyChunk)"]
319#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
320pub struct NextWasmDisassemblyChunk {
321 pub method: NextWasmDisassemblyChunkMethod,
322 pub params: NextWasmDisassemblyChunkParams,
323}
324impl NextWasmDisassemblyChunk {
325 pub const IDENTIFIER: &'static str = "Debugger.nextWasmDisassemblyChunk";
326 pub fn identifier(&self) -> &'static str {
327 Self::IDENTIFIER
328 }
329}
330impl crate::CommandResult for NextWasmDisassemblyChunk {
331 type Result = super::results::NextWasmDisassemblyChunkResult;
332}
333#[doc = "Returns stack trace with given `stackTraceId`.\n[getStackTrace](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-getStackTrace)"]
334#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
335pub struct GetStackTraceParams {
336 #[serde(rename = "stackTraceId")]
337 pub stack_trace_id: crate::js_protocol::runtime::types::StackTraceId,
338}
339impl GetStackTraceParams {
340 pub fn new(
341 stack_trace_id: impl Into<crate::js_protocol::runtime::types::StackTraceId>,
342 ) -> Self {
343 Self {
344 stack_trace_id: stack_trace_id.into(),
345 }
346 }
347}
348#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
349pub enum GetStackTraceMethod {
350 #[serde(rename = "Debugger.getStackTrace")]
351 GetStackTrace,
352}
353#[doc = "Returns stack trace with given `stackTraceId`.\n[getStackTrace](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-getStackTrace)"]
354#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
355pub struct GetStackTrace {
356 pub method: GetStackTraceMethod,
357 pub params: GetStackTraceParams,
358}
359impl GetStackTrace {
360 pub const IDENTIFIER: &'static str = "Debugger.getStackTrace";
361 pub fn identifier(&self) -> &'static str {
362 Self::IDENTIFIER
363 }
364}
365impl crate::CommandResult for GetStackTrace {
366 type Result = super::results::GetStackTraceResult;
367}
368#[doc = "Stops on the next JavaScript statement.\n[pause](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-pause)"]
369#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
370pub struct PauseParams {}
371#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
372pub enum PauseMethod {
373 #[serde(rename = "Debugger.pause")]
374 Pause,
375}
376#[doc = "Stops on the next JavaScript statement.\n[pause](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-pause)"]
377#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
378pub struct Pause {
379 pub method: PauseMethod,
380 pub params: PauseParams,
381}
382impl Pause {
383 pub const IDENTIFIER: &'static str = "Debugger.pause";
384 pub fn identifier(&self) -> &'static str {
385 Self::IDENTIFIER
386 }
387}
388impl crate::CommandResult for Pause {
389 type Result = super::results::PauseResult;
390}
391#[doc = "Removes JavaScript breakpoint.\n[removeBreakpoint](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-removeBreakpoint)"]
392#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
393pub struct RemoveBreakpointParams {
394 #[serde(rename = "breakpointId")]
395 pub breakpoint_id: super::types::BreakpointId,
396}
397impl RemoveBreakpointParams {
398 pub fn new(breakpoint_id: impl Into<super::types::BreakpointId>) -> Self {
399 Self {
400 breakpoint_id: breakpoint_id.into(),
401 }
402 }
403}
404#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
405pub enum RemoveBreakpointMethod {
406 #[serde(rename = "Debugger.removeBreakpoint")]
407 RemoveBreakpoint,
408}
409#[doc = "Removes JavaScript breakpoint.\n[removeBreakpoint](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-removeBreakpoint)"]
410#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
411pub struct RemoveBreakpoint {
412 pub method: RemoveBreakpointMethod,
413 pub params: RemoveBreakpointParams,
414}
415impl RemoveBreakpoint {
416 pub const IDENTIFIER: &'static str = "Debugger.removeBreakpoint";
417 pub fn identifier(&self) -> &'static str {
418 Self::IDENTIFIER
419 }
420}
421impl crate::CommandResult for RemoveBreakpoint {
422 type Result = super::results::RemoveBreakpointResult;
423}
424#[doc = "Restarts particular call frame from the beginning. The old, deprecated\nbehavior of `restartFrame` is to stay paused and allow further CDP commands\nafter a restart was scheduled. This can cause problems with restarting, so\nwe now continue execution immediatly after it has been scheduled until we\nreach the beginning of the restarted frame.\n\nTo stay back-wards compatible, `restartFrame` now expects a `mode`\nparameter to be present. If the `mode` parameter is missing, `restartFrame`\nerrors out.\n\nThe various return values are deprecated and `callFrames` is always empty.\nUse the call frames from the `Debugger#paused` events instead, that fires\nonce V8 pauses at the beginning of the restarted function.\n[restartFrame](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-restartFrame)"]
425#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
426pub struct RestartFrameParams {
427 #[doc = "Call frame identifier to evaluate on."]
428 #[serde(rename = "callFrameId")]
429 pub call_frame_id: super::types::CallFrameId,
430 #[doc = "The `mode` parameter must be present and set to 'StepInto', otherwise\n`restartFrame` will error out."]
431 #[serde(rename = "mode")]
432 #[serde(skip_serializing_if = "Option::is_none")]
433 #[serde(default)]
434 pub mode: Option<RestartFrameMode>,
435}
436#[doc = "The `mode` parameter must be present and set to 'StepInto', otherwise\n`restartFrame` will error out."]
437#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
438pub enum RestartFrameMode {
439 #[doc = "Pause at the beginning of the restarted function"]
440 #[serde(rename = "StepInto")]
441 StepInto,
442}
443impl RestartFrameParams {
444 pub fn new(call_frame_id: impl Into<super::types::CallFrameId>) -> Self {
445 Self {
446 call_frame_id: call_frame_id.into(),
447 mode: None,
448 }
449 }
450}
451#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
452pub enum RestartFrameMethod {
453 #[serde(rename = "Debugger.restartFrame")]
454 RestartFrame,
455}
456#[doc = "Restarts particular call frame from the beginning. The old, deprecated\nbehavior of `restartFrame` is to stay paused and allow further CDP commands\nafter a restart was scheduled. This can cause problems with restarting, so\nwe now continue execution immediatly after it has been scheduled until we\nreach the beginning of the restarted frame.\n\nTo stay back-wards compatible, `restartFrame` now expects a `mode`\nparameter to be present. If the `mode` parameter is missing, `restartFrame`\nerrors out.\n\nThe various return values are deprecated and `callFrames` is always empty.\nUse the call frames from the `Debugger#paused` events instead, that fires\nonce V8 pauses at the beginning of the restarted function.\n[restartFrame](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-restartFrame)"]
457#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
458pub struct RestartFrame {
459 pub method: RestartFrameMethod,
460 pub params: RestartFrameParams,
461}
462impl RestartFrame {
463 pub const IDENTIFIER: &'static str = "Debugger.restartFrame";
464 pub fn identifier(&self) -> &'static str {
465 Self::IDENTIFIER
466 }
467}
468impl crate::CommandResult for RestartFrame {
469 type Result = super::results::RestartFrameResult;
470}
471#[doc = "Resumes JavaScript execution.\n[resume](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-resume)"]
472#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
473pub struct ResumeParams {
474 #[doc = "Set to true to terminate execution upon resuming execution. In contrast\nto Runtime.terminateExecution, this will allows to execute further\nJavaScript (i.e. via evaluation) until execution of the paused code\nis actually resumed, at which point termination is triggered.\nIf execution is currently not paused, this parameter has no effect."]
475 #[serde(rename = "terminateOnResume")]
476 #[serde(skip_serializing_if = "Option::is_none")]
477 #[serde(default)]
478 pub terminate_on_resume: Option<bool>,
479}
480#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
481pub enum ResumeMethod {
482 #[serde(rename = "Debugger.resume")]
483 Resume,
484}
485#[doc = "Resumes JavaScript execution.\n[resume](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-resume)"]
486#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
487pub struct Resume {
488 pub method: ResumeMethod,
489 pub params: ResumeParams,
490}
491impl Resume {
492 pub const IDENTIFIER: &'static str = "Debugger.resume";
493 pub fn identifier(&self) -> &'static str {
494 Self::IDENTIFIER
495 }
496}
497impl crate::CommandResult for Resume {
498 type Result = super::results::ResumeResult;
499}
500#[doc = "Searches for given string in script content.\n[searchInContent](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-searchInContent)"]
501#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
502pub struct SearchInContentParams {
503 #[doc = "Id of the script to search in."]
504 #[serde(rename = "scriptId")]
505 pub script_id: crate::js_protocol::runtime::types::ScriptId,
506 #[doc = "String to search for."]
507 #[serde(rename = "query")]
508 pub query: String,
509 #[doc = "If true, search is case sensitive."]
510 #[serde(rename = "caseSensitive")]
511 #[serde(skip_serializing_if = "Option::is_none")]
512 #[serde(default)]
513 pub case_sensitive: Option<bool>,
514 #[doc = "If true, treats string parameter as regex."]
515 #[serde(rename = "isRegex")]
516 #[serde(skip_serializing_if = "Option::is_none")]
517 #[serde(default)]
518 pub is_regex: Option<bool>,
519}
520impl SearchInContentParams {
521 pub fn new(
522 script_id: impl Into<crate::js_protocol::runtime::types::ScriptId>,
523 query: impl Into<String>,
524 ) -> Self {
525 Self {
526 script_id: script_id.into(),
527 query: query.into(),
528 case_sensitive: None,
529 is_regex: None,
530 }
531 }
532}
533#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
534pub enum SearchInContentMethod {
535 #[serde(rename = "Debugger.searchInContent")]
536 SearchInContent,
537}
538#[doc = "Searches for given string in script content.\n[searchInContent](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-searchInContent)"]
539#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
540pub struct SearchInContent {
541 pub method: SearchInContentMethod,
542 pub params: SearchInContentParams,
543}
544impl SearchInContent {
545 pub const IDENTIFIER: &'static str = "Debugger.searchInContent";
546 pub fn identifier(&self) -> &'static str {
547 Self::IDENTIFIER
548 }
549}
550impl crate::CommandResult for SearchInContent {
551 type Result = super::results::SearchInContentResult;
552}
553#[doc = "Enables or disables async call stacks tracking.\n[setAsyncCallStackDepth](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setAsyncCallStackDepth)"]
554#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
555pub struct SetAsyncCallStackDepthParams {
556 #[doc = "Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async\ncall stacks (default)."]
557 #[serde(rename = "maxDepth")]
558 pub max_depth: i64,
559}
560impl SetAsyncCallStackDepthParams {
561 pub fn new(max_depth: impl Into<i64>) -> Self {
562 Self {
563 max_depth: max_depth.into(),
564 }
565 }
566}
567#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
568pub enum SetAsyncCallStackDepthMethod {
569 #[serde(rename = "Debugger.setAsyncCallStackDepth")]
570 SetAsyncCallStackDepth,
571}
572#[doc = "Enables or disables async call stacks tracking.\n[setAsyncCallStackDepth](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setAsyncCallStackDepth)"]
573#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
574pub struct SetAsyncCallStackDepth {
575 pub method: SetAsyncCallStackDepthMethod,
576 pub params: SetAsyncCallStackDepthParams,
577}
578impl SetAsyncCallStackDepth {
579 pub const IDENTIFIER: &'static str = "Debugger.setAsyncCallStackDepth";
580 pub fn identifier(&self) -> &'static str {
581 Self::IDENTIFIER
582 }
583}
584impl crate::CommandResult for SetAsyncCallStackDepth {
585 type Result = super::results::SetAsyncCallStackDepthResult;
586}
587#[doc = "Replace previous blackbox execution contexts with passed ones. Forces backend to skip\nstepping/pausing in scripts in these execution contexts. VM will try to leave blackboxed script by\nperforming 'step in' several times, finally resorting to 'step out' if unsuccessful.\n[setBlackboxExecutionContexts](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBlackboxExecutionContexts)"]
588#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
589pub struct SetBlackboxExecutionContextsParams {
590 #[doc = "Array of execution context unique ids for the debugger to ignore."]
591 #[serde(rename = "uniqueIds")]
592 #[serde(skip_serializing_if = "Vec::is_empty")]
593 pub unique_ids: Vec<String>,
594}
595impl SetBlackboxExecutionContextsParams {
596 pub fn new(unique_ids: Vec<String>) -> Self {
597 Self { unique_ids }
598 }
599}
600#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
601pub enum SetBlackboxExecutionContextsMethod {
602 #[serde(rename = "Debugger.setBlackboxExecutionContexts")]
603 SetBlackboxExecutionContexts,
604}
605#[doc = "Replace previous blackbox execution contexts with passed ones. Forces backend to skip\nstepping/pausing in scripts in these execution contexts. VM will try to leave blackboxed script by\nperforming 'step in' several times, finally resorting to 'step out' if unsuccessful.\n[setBlackboxExecutionContexts](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBlackboxExecutionContexts)"]
606#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
607pub struct SetBlackboxExecutionContexts {
608 pub method: SetBlackboxExecutionContextsMethod,
609 pub params: SetBlackboxExecutionContextsParams,
610}
611impl SetBlackboxExecutionContexts {
612 pub const IDENTIFIER: &'static str = "Debugger.setBlackboxExecutionContexts";
613 pub fn identifier(&self) -> &'static str {
614 Self::IDENTIFIER
615 }
616}
617impl crate::CommandResult for SetBlackboxExecutionContexts {
618 type Result = super::results::SetBlackboxExecutionContextsResult;
619}
620#[doc = "Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in\nscripts with url matching one of the patterns. VM will try to leave blackboxed script by\nperforming 'step in' several times, finally resorting to 'step out' if unsuccessful.\n[setBlackboxPatterns](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBlackboxPatterns)"]
621#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
622pub struct SetBlackboxPatternsParams {
623 #[doc = "Array of regexps that will be used to check script url for blackbox state."]
624 #[serde(rename = "patterns")]
625 #[serde(skip_serializing_if = "Vec::is_empty")]
626 pub patterns: Vec<String>,
627 #[doc = "If true, also ignore scripts with no source url."]
628 #[serde(rename = "skipAnonymous")]
629 #[serde(skip_serializing_if = "Option::is_none")]
630 #[serde(default)]
631 pub skip_anonymous: Option<bool>,
632}
633impl SetBlackboxPatternsParams {
634 pub fn new(patterns: Vec<String>) -> Self {
635 Self {
636 patterns,
637 skip_anonymous: None,
638 }
639 }
640}
641#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
642pub enum SetBlackboxPatternsMethod {
643 #[serde(rename = "Debugger.setBlackboxPatterns")]
644 SetBlackboxPatterns,
645}
646#[doc = "Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in\nscripts with url matching one of the patterns. VM will try to leave blackboxed script by\nperforming 'step in' several times, finally resorting to 'step out' if unsuccessful.\n[setBlackboxPatterns](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBlackboxPatterns)"]
647#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
648pub struct SetBlackboxPatterns {
649 pub method: SetBlackboxPatternsMethod,
650 pub params: SetBlackboxPatternsParams,
651}
652impl SetBlackboxPatterns {
653 pub const IDENTIFIER: &'static str = "Debugger.setBlackboxPatterns";
654 pub fn identifier(&self) -> &'static str {
655 Self::IDENTIFIER
656 }
657}
658impl crate::CommandResult for SetBlackboxPatterns {
659 type Result = super::results::SetBlackboxPatternsResult;
660}
661#[doc = "Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted\nscripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.\nPositions array contains positions where blackbox state is changed. First interval isn't\nblackboxed. Array should be sorted.\n[setBlackboxedRanges](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBlackboxedRanges)"]
662#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
663pub struct SetBlackboxedRangesParams {
664 #[doc = "Id of the script."]
665 #[serde(rename = "scriptId")]
666 pub script_id: crate::js_protocol::runtime::types::ScriptId,
667 #[serde(rename = "positions")]
668 #[serde(skip_serializing_if = "Vec::is_empty")]
669 pub positions: Vec<super::types::ScriptPosition>,
670}
671impl SetBlackboxedRangesParams {
672 pub fn new(
673 script_id: impl Into<crate::js_protocol::runtime::types::ScriptId>,
674 positions: Vec<super::types::ScriptPosition>,
675 ) -> Self {
676 Self {
677 script_id: script_id.into(),
678 positions,
679 }
680 }
681}
682#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
683pub enum SetBlackboxedRangesMethod {
684 #[serde(rename = "Debugger.setBlackboxedRanges")]
685 SetBlackboxedRanges,
686}
687#[doc = "Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted\nscripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.\nPositions array contains positions where blackbox state is changed. First interval isn't\nblackboxed. Array should be sorted.\n[setBlackboxedRanges](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBlackboxedRanges)"]
688#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
689pub struct SetBlackboxedRanges {
690 pub method: SetBlackboxedRangesMethod,
691 pub params: SetBlackboxedRangesParams,
692}
693impl SetBlackboxedRanges {
694 pub const IDENTIFIER: &'static str = "Debugger.setBlackboxedRanges";
695 pub fn identifier(&self) -> &'static str {
696 Self::IDENTIFIER
697 }
698}
699impl crate::CommandResult for SetBlackboxedRanges {
700 type Result = super::results::SetBlackboxedRangesResult;
701}
702#[doc = "Sets JavaScript breakpoint at a given location.\n[setBreakpoint](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBreakpoint)"]
703#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
704pub struct SetBreakpointParams {
705 #[doc = "Location to set breakpoint in."]
706 #[serde(rename = "location")]
707 pub location: super::types::Location,
708 #[doc = "Expression to use as a breakpoint condition. When specified, debugger will only stop on the\nbreakpoint if this expression evaluates to true."]
709 #[serde(rename = "condition")]
710 #[serde(skip_serializing_if = "Option::is_none")]
711 #[serde(default)]
712 pub condition: Option<String>,
713}
714impl SetBreakpointParams {
715 pub fn new(location: impl Into<super::types::Location>) -> Self {
716 Self {
717 location: location.into(),
718 condition: None,
719 }
720 }
721}
722#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
723pub enum SetBreakpointMethod {
724 #[serde(rename = "Debugger.setBreakpoint")]
725 SetBreakpoint,
726}
727#[doc = "Sets JavaScript breakpoint at a given location.\n[setBreakpoint](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBreakpoint)"]
728#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
729pub struct SetBreakpoint {
730 pub method: SetBreakpointMethod,
731 pub params: SetBreakpointParams,
732}
733impl SetBreakpoint {
734 pub const IDENTIFIER: &'static str = "Debugger.setBreakpoint";
735 pub fn identifier(&self) -> &'static str {
736 Self::IDENTIFIER
737 }
738}
739impl crate::CommandResult for SetBreakpoint {
740 type Result = super::results::SetBreakpointResult;
741}
742#[doc = "Sets instrumentation breakpoint.\n[setInstrumentationBreakpoint](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setInstrumentationBreakpoint)"]
743#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
744pub struct SetInstrumentationBreakpointParams {
745 #[doc = "Instrumentation name."]
746 #[serde(rename = "instrumentation")]
747 pub instrumentation: SetInstrumentationBreakpointInstrumentation,
748}
749#[doc = "Instrumentation name."]
750#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
751pub enum SetInstrumentationBreakpointInstrumentation {
752 #[serde(rename = "beforeScriptExecution")]
753 BeforeScriptExecution,
754 #[serde(rename = "beforeScriptWithSourceMapExecution")]
755 BeforeScriptWithSourceMapExecution,
756}
757impl SetInstrumentationBreakpointParams {
758 pub fn new(instrumentation: impl Into<SetInstrumentationBreakpointInstrumentation>) -> Self {
759 Self {
760 instrumentation: instrumentation.into(),
761 }
762 }
763}
764#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
765pub enum SetInstrumentationBreakpointMethod {
766 #[serde(rename = "Debugger.setInstrumentationBreakpoint")]
767 SetInstrumentationBreakpoint,
768}
769#[doc = "Sets instrumentation breakpoint.\n[setInstrumentationBreakpoint](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setInstrumentationBreakpoint)"]
770#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
771pub struct SetInstrumentationBreakpoint {
772 pub method: SetInstrumentationBreakpointMethod,
773 pub params: SetInstrumentationBreakpointParams,
774}
775impl SetInstrumentationBreakpoint {
776 pub const IDENTIFIER: &'static str = "Debugger.setInstrumentationBreakpoint";
777 pub fn identifier(&self) -> &'static str {
778 Self::IDENTIFIER
779 }
780}
781impl crate::CommandResult for SetInstrumentationBreakpoint {
782 type Result = super::results::SetInstrumentationBreakpointResult;
783}
784#[doc = "Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this\ncommand is issued, all existing parsed scripts will have breakpoints resolved and returned in\n`locations` property. Further matching script parsing will result in subsequent\n`breakpointResolved` events issued. This logical breakpoint will survive page reloads.\n[setBreakpointByUrl](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBreakpointByUrl)"]
785#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
786pub struct SetBreakpointByUrlParams {
787 #[doc = "Line number to set breakpoint at."]
788 #[serde(rename = "lineNumber")]
789 pub line_number: i64,
790 #[doc = "URL of the resources to set breakpoint on."]
791 #[serde(rename = "url")]
792 #[serde(skip_serializing_if = "Option::is_none")]
793 #[serde(default)]
794 pub url: Option<String>,
795 #[doc = "Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or\n`urlRegex` must be specified."]
796 #[serde(rename = "urlRegex")]
797 #[serde(skip_serializing_if = "Option::is_none")]
798 #[serde(default)]
799 pub url_regex: Option<String>,
800 #[doc = "Script hash of the resources to set breakpoint on."]
801 #[serde(rename = "scriptHash")]
802 #[serde(skip_serializing_if = "Option::is_none")]
803 #[serde(default)]
804 pub script_hash: Option<String>,
805 #[doc = "Offset in the line to set breakpoint at."]
806 #[serde(rename = "columnNumber")]
807 #[serde(skip_serializing_if = "Option::is_none")]
808 #[serde(default)]
809 pub column_number: Option<i64>,
810 #[doc = "Expression to use as a breakpoint condition. When specified, debugger will only stop on the\nbreakpoint if this expression evaluates to true."]
811 #[serde(rename = "condition")]
812 #[serde(skip_serializing_if = "Option::is_none")]
813 #[serde(default)]
814 pub condition: Option<String>,
815}
816impl SetBreakpointByUrlParams {
817 pub fn new(line_number: impl Into<i64>) -> Self {
818 Self {
819 line_number: line_number.into(),
820 url: None,
821 url_regex: None,
822 script_hash: None,
823 column_number: None,
824 condition: None,
825 }
826 }
827}
828#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
829pub enum SetBreakpointByUrlMethod {
830 #[serde(rename = "Debugger.setBreakpointByUrl")]
831 SetBreakpointByUrl,
832}
833#[doc = "Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this\ncommand is issued, all existing parsed scripts will have breakpoints resolved and returned in\n`locations` property. Further matching script parsing will result in subsequent\n`breakpointResolved` events issued. This logical breakpoint will survive page reloads.\n[setBreakpointByUrl](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBreakpointByUrl)"]
834#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
835pub struct SetBreakpointByUrl {
836 pub method: SetBreakpointByUrlMethod,
837 pub params: SetBreakpointByUrlParams,
838}
839impl SetBreakpointByUrl {
840 pub const IDENTIFIER: &'static str = "Debugger.setBreakpointByUrl";
841 pub fn identifier(&self) -> &'static str {
842 Self::IDENTIFIER
843 }
844}
845impl crate::CommandResult for SetBreakpointByUrl {
846 type Result = super::results::SetBreakpointByUrlResult;
847}
848#[doc = "Sets JavaScript breakpoint before each call to the given function.\nIf another function was created from the same source as a given one,\ncalling it will also trigger the breakpoint.\n[setBreakpointOnFunctionCall](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBreakpointOnFunctionCall)"]
849#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
850pub struct SetBreakpointOnFunctionCallParams {
851 #[doc = "Function object id."]
852 #[serde(rename = "objectId")]
853 pub object_id: crate::js_protocol::runtime::types::RemoteObjectId,
854 #[doc = "Expression to use as a breakpoint condition. When specified, debugger will\nstop on the breakpoint if this expression evaluates to true."]
855 #[serde(rename = "condition")]
856 #[serde(skip_serializing_if = "Option::is_none")]
857 #[serde(default)]
858 pub condition: Option<String>,
859}
860impl SetBreakpointOnFunctionCallParams {
861 pub fn new(object_id: impl Into<crate::js_protocol::runtime::types::RemoteObjectId>) -> Self {
862 Self {
863 object_id: object_id.into(),
864 condition: None,
865 }
866 }
867}
868#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
869pub enum SetBreakpointOnFunctionCallMethod {
870 #[serde(rename = "Debugger.setBreakpointOnFunctionCall")]
871 SetBreakpointOnFunctionCall,
872}
873#[doc = "Sets JavaScript breakpoint before each call to the given function.\nIf another function was created from the same source as a given one,\ncalling it will also trigger the breakpoint.\n[setBreakpointOnFunctionCall](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBreakpointOnFunctionCall)"]
874#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
875pub struct SetBreakpointOnFunctionCall {
876 pub method: SetBreakpointOnFunctionCallMethod,
877 pub params: SetBreakpointOnFunctionCallParams,
878}
879impl SetBreakpointOnFunctionCall {
880 pub const IDENTIFIER: &'static str = "Debugger.setBreakpointOnFunctionCall";
881 pub fn identifier(&self) -> &'static str {
882 Self::IDENTIFIER
883 }
884}
885impl crate::CommandResult for SetBreakpointOnFunctionCall {
886 type Result = super::results::SetBreakpointOnFunctionCallResult;
887}
888#[doc = "Activates / deactivates all breakpoints on the page.\n[setBreakpointsActive](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBreakpointsActive)"]
889#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
890pub struct SetBreakpointsActiveParams {
891 #[doc = "New value for breakpoints active state."]
892 #[serde(rename = "active")]
893 pub active: bool,
894}
895impl SetBreakpointsActiveParams {
896 pub fn new(active: impl Into<bool>) -> Self {
897 Self {
898 active: active.into(),
899 }
900 }
901}
902#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
903pub enum SetBreakpointsActiveMethod {
904 #[serde(rename = "Debugger.setBreakpointsActive")]
905 SetBreakpointsActive,
906}
907#[doc = "Activates / deactivates all breakpoints on the page.\n[setBreakpointsActive](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBreakpointsActive)"]
908#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
909pub struct SetBreakpointsActive {
910 pub method: SetBreakpointsActiveMethod,
911 pub params: SetBreakpointsActiveParams,
912}
913impl SetBreakpointsActive {
914 pub const IDENTIFIER: &'static str = "Debugger.setBreakpointsActive";
915 pub fn identifier(&self) -> &'static str {
916 Self::IDENTIFIER
917 }
918}
919impl crate::CommandResult for SetBreakpointsActive {
920 type Result = super::results::SetBreakpointsActiveResult;
921}
922#[doc = "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions,\nor caught exceptions, no exceptions. Initial pause on exceptions state is `none`.\n[setPauseOnExceptions](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setPauseOnExceptions)"]
923#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
924pub struct SetPauseOnExceptionsParams {
925 #[doc = "Pause on exceptions mode."]
926 #[serde(rename = "state")]
927 pub state: SetPauseOnExceptionsState,
928}
929#[doc = "Pause on exceptions mode."]
930#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
931pub enum SetPauseOnExceptionsState {
932 #[serde(rename = "none")]
933 None,
934 #[serde(rename = "caught")]
935 Caught,
936 #[serde(rename = "uncaught")]
937 Uncaught,
938 #[serde(rename = "all")]
939 All,
940}
941impl SetPauseOnExceptionsParams {
942 pub fn new(state: impl Into<SetPauseOnExceptionsState>) -> Self {
943 Self {
944 state: state.into(),
945 }
946 }
947}
948#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
949pub enum SetPauseOnExceptionsMethod {
950 #[serde(rename = "Debugger.setPauseOnExceptions")]
951 SetPauseOnExceptions,
952}
953#[doc = "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions,\nor caught exceptions, no exceptions. Initial pause on exceptions state is `none`.\n[setPauseOnExceptions](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setPauseOnExceptions)"]
954#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
955pub struct SetPauseOnExceptions {
956 pub method: SetPauseOnExceptionsMethod,
957 pub params: SetPauseOnExceptionsParams,
958}
959impl SetPauseOnExceptions {
960 pub const IDENTIFIER: &'static str = "Debugger.setPauseOnExceptions";
961 pub fn identifier(&self) -> &'static str {
962 Self::IDENTIFIER
963 }
964}
965impl crate::CommandResult for SetPauseOnExceptions {
966 type Result = super::results::SetPauseOnExceptionsResult;
967}
968#[doc = "Changes return value in top frame. Available only at return break position.\n[setReturnValue](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setReturnValue)"]
969#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
970pub struct SetReturnValueParams {
971 #[doc = "New return value."]
972 #[serde(rename = "newValue")]
973 pub new_value: crate::js_protocol::runtime::types::CallArgument,
974}
975impl SetReturnValueParams {
976 pub fn new(new_value: impl Into<crate::js_protocol::runtime::types::CallArgument>) -> Self {
977 Self {
978 new_value: new_value.into(),
979 }
980 }
981}
982#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
983pub enum SetReturnValueMethod {
984 #[serde(rename = "Debugger.setReturnValue")]
985 SetReturnValue,
986}
987#[doc = "Changes return value in top frame. Available only at return break position.\n[setReturnValue](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setReturnValue)"]
988#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
989pub struct SetReturnValue {
990 pub method: SetReturnValueMethod,
991 pub params: SetReturnValueParams,
992}
993impl SetReturnValue {
994 pub const IDENTIFIER: &'static str = "Debugger.setReturnValue";
995 pub fn identifier(&self) -> &'static str {
996 Self::IDENTIFIER
997 }
998}
999impl crate::CommandResult for SetReturnValue {
1000 type Result = super::results::SetReturnValueResult;
1001}
1002#[doc = "Edits JavaScript source live.\n\nIn general, functions that are currently on the stack can not be edited with\na single exception: If the edited function is the top-most stack frame and\nthat is the only activation of that function on the stack. In this case\nthe live edit will be successful and a `Debugger.restartFrame` for the\ntop-most function is automatically triggered.\n[setScriptSource](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setScriptSource)"]
1003#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1004pub struct SetScriptSourceParams {
1005 #[doc = "Id of the script to edit."]
1006 #[serde(rename = "scriptId")]
1007 pub script_id: crate::js_protocol::runtime::types::ScriptId,
1008 #[doc = "New content of the script."]
1009 #[serde(rename = "scriptSource")]
1010 pub script_source: String,
1011 #[doc = "If true the change will not actually be applied. Dry run may be used to get result\ndescription without actually modifying the code."]
1012 #[serde(rename = "dryRun")]
1013 #[serde(skip_serializing_if = "Option::is_none")]
1014 #[serde(default)]
1015 pub dry_run: Option<bool>,
1016 #[doc = "If true, then `scriptSource` is allowed to change the function on top of the stack\nas long as the top-most stack frame is the only activation of that function."]
1017 #[serde(rename = "allowTopFrameEditing")]
1018 #[serde(skip_serializing_if = "Option::is_none")]
1019 #[serde(default)]
1020 pub allow_top_frame_editing: Option<bool>,
1021}
1022impl SetScriptSourceParams {
1023 pub fn new(
1024 script_id: impl Into<crate::js_protocol::runtime::types::ScriptId>,
1025 script_source: impl Into<String>,
1026 ) -> Self {
1027 Self {
1028 script_id: script_id.into(),
1029 script_source: script_source.into(),
1030 dry_run: None,
1031 allow_top_frame_editing: None,
1032 }
1033 }
1034}
1035#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1036pub enum SetScriptSourceMethod {
1037 #[serde(rename = "Debugger.setScriptSource")]
1038 SetScriptSource,
1039}
1040#[doc = "Edits JavaScript source live.\n\nIn general, functions that are currently on the stack can not be edited with\na single exception: If the edited function is the top-most stack frame and\nthat is the only activation of that function on the stack. In this case\nthe live edit will be successful and a `Debugger.restartFrame` for the\ntop-most function is automatically triggered.\n[setScriptSource](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setScriptSource)"]
1041#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1042pub struct SetScriptSource {
1043 pub method: SetScriptSourceMethod,
1044 pub params: SetScriptSourceParams,
1045}
1046impl SetScriptSource {
1047 pub const IDENTIFIER: &'static str = "Debugger.setScriptSource";
1048 pub fn identifier(&self) -> &'static str {
1049 Self::IDENTIFIER
1050 }
1051}
1052impl crate::CommandResult for SetScriptSource {
1053 type Result = super::results::SetScriptSourceResult;
1054}
1055#[doc = "Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).\n[setSkipAllPauses](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setSkipAllPauses)"]
1056#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1057pub struct SetSkipAllPausesParams {
1058 #[doc = "New value for skip pauses state."]
1059 #[serde(rename = "skip")]
1060 pub skip: bool,
1061}
1062impl SetSkipAllPausesParams {
1063 pub fn new(skip: impl Into<bool>) -> Self {
1064 Self { skip: skip.into() }
1065 }
1066}
1067#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1068pub enum SetSkipAllPausesMethod {
1069 #[serde(rename = "Debugger.setSkipAllPauses")]
1070 SetSkipAllPauses,
1071}
1072#[doc = "Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).\n[setSkipAllPauses](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setSkipAllPauses)"]
1073#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1074pub struct SetSkipAllPauses {
1075 pub method: SetSkipAllPausesMethod,
1076 pub params: SetSkipAllPausesParams,
1077}
1078impl SetSkipAllPauses {
1079 pub const IDENTIFIER: &'static str = "Debugger.setSkipAllPauses";
1080 pub fn identifier(&self) -> &'static str {
1081 Self::IDENTIFIER
1082 }
1083}
1084impl crate::CommandResult for SetSkipAllPauses {
1085 type Result = super::results::SetSkipAllPausesResult;
1086}
1087#[doc = "Changes value of variable in a callframe. Object-based scopes are not supported and must be\nmutated manually.\n[setVariableValue](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setVariableValue)"]
1088#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1089pub struct SetVariableValueParams {
1090 #[doc = "0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch'\nscope types are allowed. Other scopes could be manipulated manually."]
1091 #[serde(rename = "scopeNumber")]
1092 pub scope_number: i64,
1093 #[doc = "Variable name."]
1094 #[serde(rename = "variableName")]
1095 pub variable_name: String,
1096 #[doc = "New variable value."]
1097 #[serde(rename = "newValue")]
1098 pub new_value: crate::js_protocol::runtime::types::CallArgument,
1099 #[doc = "Id of callframe that holds variable."]
1100 #[serde(rename = "callFrameId")]
1101 pub call_frame_id: super::types::CallFrameId,
1102}
1103impl SetVariableValueParams {
1104 pub fn new(
1105 scope_number: impl Into<i64>,
1106 variable_name: impl Into<String>,
1107 new_value: impl Into<crate::js_protocol::runtime::types::CallArgument>,
1108 call_frame_id: impl Into<super::types::CallFrameId>,
1109 ) -> Self {
1110 Self {
1111 scope_number: scope_number.into(),
1112 variable_name: variable_name.into(),
1113 new_value: new_value.into(),
1114 call_frame_id: call_frame_id.into(),
1115 }
1116 }
1117}
1118#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1119pub enum SetVariableValueMethod {
1120 #[serde(rename = "Debugger.setVariableValue")]
1121 SetVariableValue,
1122}
1123#[doc = "Changes value of variable in a callframe. Object-based scopes are not supported and must be\nmutated manually.\n[setVariableValue](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setVariableValue)"]
1124#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1125pub struct SetVariableValue {
1126 pub method: SetVariableValueMethod,
1127 pub params: SetVariableValueParams,
1128}
1129impl SetVariableValue {
1130 pub const IDENTIFIER: &'static str = "Debugger.setVariableValue";
1131 pub fn identifier(&self) -> &'static str {
1132 Self::IDENTIFIER
1133 }
1134}
1135impl crate::CommandResult for SetVariableValue {
1136 type Result = super::results::SetVariableValueResult;
1137}
1138#[doc = "Steps into the function call.\n[stepInto](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-stepInto)"]
1139#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
1140pub struct StepIntoParams {
1141 #[doc = "Debugger will pause on the execution of the first async task which was scheduled\nbefore next pause."]
1142 #[serde(rename = "breakOnAsyncCall")]
1143 #[serde(skip_serializing_if = "Option::is_none")]
1144 #[serde(default)]
1145 pub break_on_async_call: Option<bool>,
1146 #[doc = "The skipList specifies location ranges that should be skipped on step into."]
1147 #[serde(rename = "skipList")]
1148 #[serde(skip_serializing_if = "Option::is_none")]
1149 #[serde(default)]
1150 pub skip_list: Option<Vec<super::types::LocationRange>>,
1151}
1152#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1153pub enum StepIntoMethod {
1154 #[serde(rename = "Debugger.stepInto")]
1155 StepInto,
1156}
1157#[doc = "Steps into the function call.\n[stepInto](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-stepInto)"]
1158#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1159pub struct StepInto {
1160 pub method: StepIntoMethod,
1161 pub params: StepIntoParams,
1162}
1163impl StepInto {
1164 pub const IDENTIFIER: &'static str = "Debugger.stepInto";
1165 pub fn identifier(&self) -> &'static str {
1166 Self::IDENTIFIER
1167 }
1168}
1169impl crate::CommandResult for StepInto {
1170 type Result = super::results::StepIntoResult;
1171}
1172#[doc = "Steps out of the function call.\n[stepOut](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-stepOut)"]
1173#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1174pub struct StepOutParams {}
1175#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1176pub enum StepOutMethod {
1177 #[serde(rename = "Debugger.stepOut")]
1178 StepOut,
1179}
1180#[doc = "Steps out of the function call.\n[stepOut](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-stepOut)"]
1181#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1182pub struct StepOut {
1183 pub method: StepOutMethod,
1184 pub params: StepOutParams,
1185}
1186impl StepOut {
1187 pub const IDENTIFIER: &'static str = "Debugger.stepOut";
1188 pub fn identifier(&self) -> &'static str {
1189 Self::IDENTIFIER
1190 }
1191}
1192impl crate::CommandResult for StepOut {
1193 type Result = super::results::StepOutResult;
1194}
1195#[doc = "Steps over the statement.\n[stepOver](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-stepOver)"]
1196#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
1197pub struct StepOverParams {
1198 #[doc = "The skipList specifies location ranges that should be skipped on step over."]
1199 #[serde(rename = "skipList")]
1200 #[serde(skip_serializing_if = "Option::is_none")]
1201 #[serde(default)]
1202 pub skip_list: Option<Vec<super::types::LocationRange>>,
1203}
1204#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1205pub enum StepOverMethod {
1206 #[serde(rename = "Debugger.stepOver")]
1207 StepOver,
1208}
1209#[doc = "Steps over the statement.\n[stepOver](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-stepOver)"]
1210#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1211pub struct StepOver {
1212 pub method: StepOverMethod,
1213 pub params: StepOverParams,
1214}
1215impl StepOver {
1216 pub const IDENTIFIER: &'static str = "Debugger.stepOver";
1217 pub fn identifier(&self) -> &'static str {
1218 Self::IDENTIFIER
1219 }
1220}
1221impl crate::CommandResult for StepOver {
1222 type Result = super::results::StepOverResult;
1223}
1224group_enum ! (DebuggerCommands { ContinueToLocation (ContinueToLocation) , Disable (Disable) , Enable (Enable) , EvaluateOnCallFrame (EvaluateOnCallFrame) , GetPossibleBreakpoints (GetPossibleBreakpoints) , GetScriptSource (GetScriptSource) , DisassembleWasmModule (DisassembleWasmModule) , NextWasmDisassemblyChunk (NextWasmDisassemblyChunk) , GetStackTrace (GetStackTrace) , Pause (Pause) , RemoveBreakpoint (RemoveBreakpoint) , RestartFrame (RestartFrame) , Resume (Resume) , SearchInContent (SearchInContent) , SetAsyncCallStackDepth (SetAsyncCallStackDepth) , SetBlackboxExecutionContexts (SetBlackboxExecutionContexts) , SetBlackboxPatterns (SetBlackboxPatterns) , SetBlackboxedRanges (SetBlackboxedRanges) , SetBreakpoint (SetBreakpoint) , SetInstrumentationBreakpoint (SetInstrumentationBreakpoint) , SetBreakpointByUrl (SetBreakpointByUrl) , SetBreakpointOnFunctionCall (SetBreakpointOnFunctionCall) , SetBreakpointsActive (SetBreakpointsActive) , SetPauseOnExceptions (SetPauseOnExceptions) , SetReturnValue (SetReturnValue) , SetScriptSource (SetScriptSource) , SetSkipAllPauses (SetSkipAllPauses) , SetVariableValue (SetVariableValue) , StepInto (StepInto) , StepOut (StepOut) , StepOver (StepOver) } + identifiable);