Skip to main content

cdp_driver/protocol/
debugger.rs

1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! Debugger domain exposes JavaScript debugging capabilities. It allows
5//! setting and removing breakpoints, stepping through execution, exploring
6//! stack traces, etc.
7//!
8//! Types, command parameters and event payloads for the `Debugger`
9//! domain. The method-name constants for the same domain are in
10//! [`crate::methods`].
11
12use serde::{Deserialize, Serialize};
13
14/// Breakpoint identifier.
15pub type BreakpointId = String;
16
17/// Call frame identifier.
18pub type CallFrameId = String;
19
20/// Location in the source code.
21#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
22pub struct Location {
23    /// Script identifier as reported in the `Debugger.scriptParsed`.
24    #[serde(rename = "scriptId")]
25    pub script_id: crate::protocol::runtime::ScriptId,
26    /// Line number in the script (0-based).
27    #[serde(rename = "lineNumber")]
28    pub line_number: i64,
29    /// Column number in the script (0-based).
30    #[serde(
31        rename = "columnNumber",
32        default,
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub column_number: Option<i64>,
36}
37
38/// Location in the source code.
39///
40/// Experimental: may change without notice.
41#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
42pub struct ScriptPosition {
43    #[serde(rename = "lineNumber")]
44    pub line_number: i64,
45    #[serde(rename = "columnNumber")]
46    pub column_number: i64,
47}
48
49/// Location range within one script.
50///
51/// Experimental: may change without notice.
52#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
53pub struct LocationRange {
54    #[serde(rename = "scriptId")]
55    pub script_id: crate::protocol::runtime::ScriptId,
56    pub start: ScriptPosition,
57    pub end: ScriptPosition,
58}
59
60/// JavaScript call frame. Array of call frames form the call stack.
61#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
62pub struct CallFrame {
63    /// Call frame identifier. This identifier is only valid while the virtual
64    /// machine is paused.
65    #[serde(rename = "callFrameId")]
66    pub call_frame_id: CallFrameId,
67    /// Name of the JavaScript function called on this call frame.
68    #[serde(rename = "functionName")]
69    pub function_name: String,
70    /// Location in the source code.
71    #[serde(
72        rename = "functionLocation",
73        default,
74        skip_serializing_if = "Option::is_none"
75    )]
76    pub function_location: Option<Location>,
77    /// Location in the source code.
78    pub location: Location,
79    /// JavaScript script name or url. Deprecated in favor of using the
80    /// `location.scriptId` to resolve the URL via a previously sent
81    /// `Debugger.scriptParsed` event.
82    ///
83    /// Deprecated in the protocol.
84    pub url: String,
85    /// Scope chain for this call frame.
86    #[serde(rename = "scopeChain")]
87    pub scope_chain: Vec<Scope>,
88    /// `this` object for this call frame.
89    pub this: crate::protocol::runtime::RemoteObject,
90    /// The value being returned, if the function is at return point.
91    #[serde(
92        rename = "returnValue",
93        default,
94        skip_serializing_if = "Option::is_none"
95    )]
96    pub return_value: Option<crate::protocol::runtime::RemoteObject>,
97    /// Valid only while the VM is paused and indicates whether this frame can be
98    /// restarted or not. Note that a `true` value here does not guarantee that
99    /// Debugger#restartFrame with this CallFrameId will be successful, but it is
100    /// very likely.
101    ///
102    /// Experimental: may change without notice.
103    #[serde(
104        rename = "canBeRestarted",
105        default,
106        skip_serializing_if = "Option::is_none"
107    )]
108    pub can_be_restarted: Option<bool>,
109}
110
111/// Scope description.
112#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
113pub struct Scope {
114    /// Scope type.
115    pub r#type: ScopeType,
116    /// Object representing the scope. For `global` and `with` scopes it
117    /// represents the actual object; for the rest of the scopes, it is artificial
118    /// transient object enumerating scope variables as its properties.
119    pub object: crate::protocol::runtime::RemoteObject,
120    #[serde(default, skip_serializing_if = "Option::is_none")]
121    pub name: Option<String>,
122    /// Location in the source code where scope starts
123    #[serde(
124        rename = "startLocation",
125        default,
126        skip_serializing_if = "Option::is_none"
127    )]
128    pub start_location: Option<Location>,
129    /// Location in the source code where scope ends
130    #[serde(
131        rename = "endLocation",
132        default,
133        skip_serializing_if = "Option::is_none"
134    )]
135    pub end_location: Option<Location>,
136    /// Present if the scope has no variable values to show. Absent means that the
137    /// scope declares at least one variable with an available value. Empty scopes
138    /// are retained in the scope chain because they can be targeted via
139    /// `evaluateOnCallFrame` (using `scopeNumber`) or matched against scopes in
140    /// source maps.
141    ///
142    /// Experimental: may change without notice.
143    #[serde(
144        rename = "emptyReason",
145        default,
146        skip_serializing_if = "Option::is_none"
147    )]
148    pub empty_reason: Option<ScopeEmptyReason>,
149}
150
151/// The values `type` accepts on `Scope`.
152#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
153pub enum ScopeType {
154    /// `global`
155    #[serde(rename = "global")]
156    Global,
157    /// `local`
158    #[serde(rename = "local")]
159    Local,
160    /// `with`
161    #[serde(rename = "with")]
162    With,
163    /// `closure`
164    #[serde(rename = "closure")]
165    Closure,
166    /// `catch`
167    #[serde(rename = "catch")]
168    Catch,
169    /// `block`
170    #[serde(rename = "block")]
171    Block,
172    /// `script`
173    #[serde(rename = "script")]
174    Script,
175    /// `eval`
176    #[serde(rename = "eval")]
177    Eval,
178    /// `module`
179    #[serde(rename = "module")]
180    Module,
181    /// `wasm-expression-stack`
182    #[serde(rename = "wasm-expression-stack")]
183    WasmExpressionStack,
184    /// A value this vendored schema does not list. Chrome adds values ahead of
185    /// the published protocol, so an unrecognised one is kept as it arrived
186    /// rather than failing the payload it came in.
187    #[serde(untagged)]
188    Unrecognized(String),
189}
190
191/// The values `emptyReason` accepts on `Scope`.
192#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
193pub enum ScopeEmptyReason {
194    /// `no-variables`
195    #[serde(rename = "no-variables")]
196    NoVariables,
197    /// `all-unavailable`
198    #[serde(rename = "all-unavailable")]
199    AllUnavailable,
200    /// A value this vendored schema does not list. Chrome adds values ahead of
201    /// the published protocol, so an unrecognised one is kept as it arrived
202    /// rather than failing the payload it came in.
203    #[serde(untagged)]
204    Unrecognized(String),
205}
206
207/// Search match for resource.
208#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
209pub struct SearchMatch {
210    /// Line number in resource content.
211    #[serde(rename = "lineNumber")]
212    pub line_number: f64,
213    /// Line with match content.
214    #[serde(rename = "lineContent")]
215    pub line_content: String,
216}
217
218#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
219pub struct BreakLocation {
220    /// Script identifier as reported in the `Debugger.scriptParsed`.
221    #[serde(rename = "scriptId")]
222    pub script_id: crate::protocol::runtime::ScriptId,
223    /// Line number in the script (0-based).
224    #[serde(rename = "lineNumber")]
225    pub line_number: i64,
226    /// Column number in the script (0-based).
227    #[serde(
228        rename = "columnNumber",
229        default,
230        skip_serializing_if = "Option::is_none"
231    )]
232    pub column_number: Option<i64>,
233    #[serde(default, skip_serializing_if = "Option::is_none")]
234    pub r#type: Option<BreakLocationType>,
235}
236
237/// The values `type` accepts on `BreakLocation`.
238#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
239pub enum BreakLocationType {
240    /// `debuggerStatement`
241    #[serde(rename = "debuggerStatement")]
242    DebuggerStatement,
243    /// `call`
244    #[serde(rename = "call")]
245    Call,
246    /// `return`
247    #[serde(rename = "return")]
248    Return,
249    /// A value this vendored schema does not list. Chrome adds values ahead of
250    /// the published protocol, so an unrecognised one is kept as it arrived
251    /// rather than failing the payload it came in.
252    #[serde(untagged)]
253    Unrecognized(String),
254}
255
256/// Experimental: may change without notice.
257#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
258pub struct WasmDisassemblyChunk {
259    /// The next chunk of disassembled lines.
260    pub lines: Vec<String>,
261    /// The bytecode offsets describing the start of each line.
262    #[serde(rename = "bytecodeOffsets")]
263    pub bytecode_offsets: Vec<i64>,
264}
265
266/// Enum of possible script languages.
267#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
268pub enum ScriptLanguage {
269    /// `JavaScript`
270    JavaScript,
271    /// `WebAssembly`
272    WebAssembly,
273    /// A value this vendored schema does not list. Chrome adds values ahead of
274    /// the published protocol, so an unrecognised one is kept as it arrived
275    /// rather than failing the payload it came in.
276    #[serde(untagged)]
277    Unrecognized(String),
278}
279
280/// Debug symbols available for a wasm script.
281#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
282pub struct DebugSymbols {
283    /// Type of the debug symbols.
284    pub r#type: DebugSymbolsType,
285    /// URL of the external symbol source.
286    #[serde(
287        rename = "externalURL",
288        default,
289        skip_serializing_if = "Option::is_none"
290    )]
291    pub external_url: Option<String>,
292}
293
294/// The values `type` accepts on `DebugSymbols`.
295#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
296pub enum DebugSymbolsType {
297    /// `SourceMap`
298    SourceMap,
299    /// `EmbeddedDWARF`
300    #[serde(rename = "EmbeddedDWARF")]
301    EmbeddedDwarf,
302    /// `ExternalDWARF`
303    #[serde(rename = "ExternalDWARF")]
304    ExternalDwarf,
305    /// A value this vendored schema does not list. Chrome adds values ahead of
306    /// the published protocol, so an unrecognised one is kept as it arrived
307    /// rather than failing the payload it came in.
308    #[serde(untagged)]
309    Unrecognized(String),
310}
311
312#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
313pub struct ResolvedBreakpoint {
314    /// Breakpoint unique identifier.
315    #[serde(rename = "breakpointId")]
316    pub breakpoint_id: BreakpointId,
317    /// Actual breakpoint location.
318    pub location: Location,
319}
320
321/// Continues execution until specific location is reached.
322///
323/// Parameters of `Debugger.continueToLocation`.
324#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
325pub struct ContinueToLocationParams {
326    /// Location to continue to.
327    pub location: Location,
328    #[serde(
329        rename = "targetCallFrames",
330        default,
331        skip_serializing_if = "Option::is_none"
332    )]
333    pub target_call_frames: Option<ContinueToLocationTargetCallFrames>,
334}
335
336/// The values `targetCallFrames` accepts on `continueToLocation`.
337#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
338pub enum ContinueToLocationTargetCallFrames {
339    /// `any`
340    #[serde(rename = "any")]
341    Any,
342    /// `current`
343    #[serde(rename = "current")]
344    Current,
345    /// A value this vendored schema does not list. Chrome adds values ahead of
346    /// the published protocol, so an unrecognised one is kept as it arrived
347    /// rather than failing the payload it came in.
348    #[serde(untagged)]
349    Unrecognized(String),
350}
351
352impl crate::typed::Command for ContinueToLocationParams {
353    const METHOD: &'static str = "Debugger.continueToLocation";
354    type Returns = crate::typed::NoReturns;
355}
356
357/// Disables debugger for given page.
358///
359/// Parameters of `Debugger.disable`.
360#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
361pub struct DisableParams {}
362
363impl crate::typed::Command for DisableParams {
364    const METHOD: &'static str = "Debugger.disable";
365    type Returns = crate::typed::NoReturns;
366}
367
368/// Enables debugger for the given page. Clients should not assume that the
369/// debugging has been enabled until the result for this command is received.
370///
371/// Parameters of `Debugger.enable`.
372#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
373pub struct EnableParams {
374    /// The maximum size in bytes of collected scripts (not referenced by other
375    /// heap objects) the debugger can hold. Puts no limit if parameter is
376    /// omitted.
377    ///
378    /// Experimental: may change without notice.
379    #[serde(
380        rename = "maxScriptsCacheSize",
381        default,
382        skip_serializing_if = "Option::is_none"
383    )]
384    pub max_scripts_cache_size: Option<f64>,
385}
386
387/// What `Debugger.enable` answers with.
388#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
389pub struct EnableReturns {
390    /// Unique identifier of the debugger.
391    ///
392    /// Experimental: may change without notice.
393    #[serde(rename = "debuggerId")]
394    pub debugger_id: crate::protocol::runtime::UniqueDebuggerId,
395}
396
397impl crate::typed::Command for EnableParams {
398    const METHOD: &'static str = "Debugger.enable";
399    type Returns = EnableReturns;
400}
401
402/// Evaluates expression on a given call frame.
403///
404/// Parameters of `Debugger.evaluateOnCallFrame`.
405#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
406pub struct EvaluateOnCallFrameParams {
407    /// Call frame identifier to evaluate on.
408    #[serde(rename = "callFrameId")]
409    pub call_frame_id: CallFrameId,
410    /// Expression to evaluate.
411    pub expression: String,
412    /// String object group name to put result into (allows rapid releasing
413    /// resulting object handles using `releaseObjectGroup`).
414    #[serde(
415        rename = "objectGroup",
416        default,
417        skip_serializing_if = "Option::is_none"
418    )]
419    pub object_group: Option<String>,
420    /// Specifies whether command line API should be available to the evaluated
421    /// expression, defaults to false.
422    #[serde(
423        rename = "includeCommandLineAPI",
424        default,
425        skip_serializing_if = "Option::is_none"
426    )]
427    pub include_command_line_api: Option<bool>,
428    /// In silent mode exceptions thrown during evaluation are not reported and do
429    /// not pause execution. Overrides `setPauseOnException` state.
430    #[serde(default, skip_serializing_if = "Option::is_none")]
431    pub silent: Option<bool>,
432    /// Whether the result is expected to be a JSON object that should be sent by
433    /// value.
434    #[serde(
435        rename = "returnByValue",
436        default,
437        skip_serializing_if = "Option::is_none"
438    )]
439    pub return_by_value: Option<bool>,
440    /// Whether preview should be generated for the result.
441    ///
442    /// Experimental: may change without notice.
443    #[serde(
444        rename = "generatePreview",
445        default,
446        skip_serializing_if = "Option::is_none"
447    )]
448    pub generate_preview: Option<bool>,
449    /// Whether to throw an exception if side effect cannot be ruled out during
450    /// evaluation.
451    #[serde(
452        rename = "throwOnSideEffect",
453        default,
454        skip_serializing_if = "Option::is_none"
455    )]
456    pub throw_on_side_effect: Option<bool>,
457    /// Terminate execution after timing out (number of milliseconds).
458    ///
459    /// Experimental: may change without notice.
460    #[serde(default, skip_serializing_if = "Option::is_none")]
461    pub timeout: Option<crate::protocol::runtime::TimeDelta>,
462    /// Specifies the scope number to evaluate the expression in (default: 0,
463    /// innermost scope).
464    ///
465    /// Experimental: may change without notice.
466    #[serde(
467        rename = "scopeNumber",
468        default,
469        skip_serializing_if = "Option::is_none"
470    )]
471    pub scope_number: Option<i64>,
472}
473
474/// What `Debugger.evaluateOnCallFrame` answers with.
475#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
476pub struct EvaluateOnCallFrameReturns {
477    /// Object wrapper for the evaluation result.
478    pub result: crate::protocol::runtime::RemoteObject,
479    /// Exception details.
480    #[serde(
481        rename = "exceptionDetails",
482        default,
483        skip_serializing_if = "Option::is_none"
484    )]
485    pub exception_details: Option<crate::protocol::runtime::ExceptionDetails>,
486}
487
488impl crate::typed::Command for EvaluateOnCallFrameParams {
489    const METHOD: &'static str = "Debugger.evaluateOnCallFrame";
490    type Returns = EvaluateOnCallFrameReturns;
491}
492
493/// Returns possible locations for breakpoint. scriptId in start and end range
494/// locations should be the same.
495///
496/// Parameters of `Debugger.getPossibleBreakpoints`.
497#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
498pub struct GetPossibleBreakpointsParams {
499    /// Start of range to search possible breakpoint locations in.
500    pub start: Location,
501    /// End of range to search possible breakpoint locations in (excluding). When
502    /// not specified, end of scripts is used as end of range.
503    #[serde(default, skip_serializing_if = "Option::is_none")]
504    pub end: Option<Location>,
505    /// Only consider locations which are in the same (non-nested) function as
506    /// start.
507    #[serde(
508        rename = "restrictToFunction",
509        default,
510        skip_serializing_if = "Option::is_none"
511    )]
512    pub restrict_to_function: Option<bool>,
513}
514
515/// What `Debugger.getPossibleBreakpoints` answers with.
516#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
517pub struct GetPossibleBreakpointsReturns {
518    /// List of the possible breakpoint locations.
519    pub locations: Vec<BreakLocation>,
520}
521
522impl crate::typed::Command for GetPossibleBreakpointsParams {
523    const METHOD: &'static str = "Debugger.getPossibleBreakpoints";
524    type Returns = GetPossibleBreakpointsReturns;
525}
526
527/// Returns source for the script with given id.
528///
529/// Parameters of `Debugger.getScriptSource`.
530#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
531pub struct GetScriptSourceParams {
532    /// Id of the script to get source for.
533    #[serde(rename = "scriptId")]
534    pub script_id: crate::protocol::runtime::ScriptId,
535}
536
537/// What `Debugger.getScriptSource` answers with.
538#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
539pub struct GetScriptSourceReturns {
540    /// Script source (empty in case of Wasm bytecode).
541    #[serde(rename = "scriptSource")]
542    pub script_source: String,
543    /// Wasm bytecode. (Encoded as a base64 string when passed over JSON)
544    #[serde(default, skip_serializing_if = "Option::is_none")]
545    pub bytecode: Option<String>,
546}
547
548impl crate::typed::Command for GetScriptSourceParams {
549    const METHOD: &'static str = "Debugger.getScriptSource";
550    type Returns = GetScriptSourceReturns;
551}
552
553/// Experimental: may change without notice.
554///
555/// Parameters of `Debugger.disassembleWasmModule`.
556#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
557pub struct DisassembleWasmModuleParams {
558    /// Id of the script to disassemble
559    #[serde(rename = "scriptId")]
560    pub script_id: crate::protocol::runtime::ScriptId,
561}
562
563/// What `Debugger.disassembleWasmModule` answers with.
564#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
565pub struct DisassembleWasmModuleReturns {
566    /// For large modules, return a stream from which additional chunks of
567    /// disassembly can be read successively.
568    #[serde(rename = "streamId", default, skip_serializing_if = "Option::is_none")]
569    pub stream_id: Option<String>,
570    /// The total number of lines in the disassembly text.
571    #[serde(rename = "totalNumberOfLines")]
572    pub total_number_of_lines: i64,
573    /// The offsets of all function bodies, in the format \[start1, end1, start2,
574    /// end2, ...\] where all ends are exclusive.
575    #[serde(rename = "functionBodyOffsets")]
576    pub function_body_offsets: Vec<i64>,
577    /// The first chunk of disassembly.
578    pub chunk: WasmDisassemblyChunk,
579}
580
581impl crate::typed::Command for DisassembleWasmModuleParams {
582    const METHOD: &'static str = "Debugger.disassembleWasmModule";
583    type Returns = DisassembleWasmModuleReturns;
584}
585
586/// Disassemble the next chunk of lines for the module corresponding to the
587/// stream. If disassembly is complete, this API will invalidate the streamId
588/// and return an empty chunk. Any subsequent calls for the now invalid stream
589/// will return errors.
590///
591/// Experimental: may change without notice.
592///
593/// Parameters of `Debugger.nextWasmDisassemblyChunk`.
594#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
595pub struct NextWasmDisassemblyChunkParams {
596    #[serde(rename = "streamId")]
597    pub stream_id: String,
598}
599
600/// What `Debugger.nextWasmDisassemblyChunk` answers with.
601#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
602pub struct NextWasmDisassemblyChunkReturns {
603    /// The next chunk of disassembly.
604    pub chunk: WasmDisassemblyChunk,
605}
606
607impl crate::typed::Command for NextWasmDisassemblyChunkParams {
608    const METHOD: &'static str = "Debugger.nextWasmDisassemblyChunk";
609    type Returns = NextWasmDisassemblyChunkReturns;
610}
611
612/// This command is deprecated. Use getScriptSource instead.
613///
614/// Deprecated in the protocol.
615///
616/// Parameters of `Debugger.getWasmBytecode`.
617#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
618pub struct GetWasmBytecodeParams {
619    /// Id of the Wasm script to get source for.
620    #[serde(rename = "scriptId")]
621    pub script_id: crate::protocol::runtime::ScriptId,
622}
623
624/// What `Debugger.getWasmBytecode` answers with.
625#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
626pub struct GetWasmBytecodeReturns {
627    /// Script source. (Encoded as a base64 string when passed over JSON)
628    pub bytecode: String,
629}
630
631impl crate::typed::Command for GetWasmBytecodeParams {
632    const METHOD: &'static str = "Debugger.getWasmBytecode";
633    type Returns = GetWasmBytecodeReturns;
634}
635
636/// Returns stack trace with given `stackTraceId`.
637///
638/// Experimental: may change without notice.
639///
640/// Parameters of `Debugger.getStackTrace`.
641#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
642pub struct GetStackTraceParams {
643    #[serde(rename = "stackTraceId")]
644    pub stack_trace_id: crate::protocol::runtime::StackTraceId,
645}
646
647/// What `Debugger.getStackTrace` answers with.
648#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
649pub struct GetStackTraceReturns {
650    #[serde(rename = "stackTrace")]
651    pub stack_trace: crate::protocol::runtime::StackTrace,
652}
653
654impl crate::typed::Command for GetStackTraceParams {
655    const METHOD: &'static str = "Debugger.getStackTrace";
656    type Returns = GetStackTraceReturns;
657}
658
659/// Stops on the next JavaScript statement.
660///
661/// Parameters of `Debugger.pause`.
662#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
663pub struct PauseParams {}
664
665impl crate::typed::Command for PauseParams {
666    const METHOD: &'static str = "Debugger.pause";
667    type Returns = crate::typed::NoReturns;
668}
669
670/// Deprecated in the protocol.
671///
672/// Experimental: may change without notice.
673///
674/// Parameters of `Debugger.pauseOnAsyncCall`.
675#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
676pub struct PauseOnAsyncCallParams {
677    /// Debugger will pause when async call with given stack trace is started.
678    #[serde(rename = "parentStackTraceId")]
679    pub parent_stack_trace_id: crate::protocol::runtime::StackTraceId,
680}
681
682impl crate::typed::Command for PauseOnAsyncCallParams {
683    const METHOD: &'static str = "Debugger.pauseOnAsyncCall";
684    type Returns = crate::typed::NoReturns;
685}
686
687/// Removes JavaScript breakpoint.
688///
689/// Parameters of `Debugger.removeBreakpoint`.
690#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
691pub struct RemoveBreakpointParams {
692    #[serde(rename = "breakpointId")]
693    pub breakpoint_id: BreakpointId,
694}
695
696impl crate::typed::Command for RemoveBreakpointParams {
697    const METHOD: &'static str = "Debugger.removeBreakpoint";
698    type Returns = crate::typed::NoReturns;
699}
700
701/// Restarts particular call frame from the beginning. The old, deprecated
702/// behavior of `restartFrame` is to stay paused and allow further CDP
703/// commands after a restart was scheduled. This can cause problems with
704/// restarting, so we now continue execution immediatly after it has been
705/// scheduled until we reach the beginning of the restarted frame. To stay
706/// back-wards compatible, `restartFrame` now expects a `mode` parameter to be
707/// present. If the `mode` parameter is missing, `restartFrame` errors out.
708/// The various return values are deprecated and `callFrames` is always empty.
709/// Use the call frames from the `Debugger#paused` events instead, that fires
710/// once V8 pauses at the beginning of the restarted function.
711///
712/// Parameters of `Debugger.restartFrame`.
713#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
714pub struct RestartFrameParams {
715    /// Call frame identifier to evaluate on.
716    #[serde(rename = "callFrameId")]
717    pub call_frame_id: CallFrameId,
718    /// The `mode` parameter must be present and set to 'StepInto', otherwise
719    /// `restartFrame` will error out.
720    ///
721    /// Experimental: may change without notice.
722    #[serde(default, skip_serializing_if = "Option::is_none")]
723    pub mode: Option<RestartFrameMode>,
724}
725
726/// The values `mode` accepts on `restartFrame`.
727#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
728pub enum RestartFrameMode {
729    /// `StepInto`
730    StepInto,
731    /// A value this vendored schema does not list. Chrome adds values ahead of
732    /// the published protocol, so an unrecognised one is kept as it arrived
733    /// rather than failing the payload it came in.
734    #[serde(untagged)]
735    Unrecognized(String),
736}
737
738/// What `Debugger.restartFrame` answers with.
739#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
740pub struct RestartFrameReturns {
741    /// New stack trace.
742    ///
743    /// Deprecated in the protocol.
744    #[serde(rename = "callFrames")]
745    pub call_frames: Vec<CallFrame>,
746    /// Async stack trace, if any.
747    ///
748    /// Deprecated in the protocol.
749    #[serde(
750        rename = "asyncStackTrace",
751        default,
752        skip_serializing_if = "Option::is_none"
753    )]
754    pub async_stack_trace: Option<crate::protocol::runtime::StackTrace>,
755    /// Async stack trace, if any.
756    ///
757    /// Deprecated in the protocol.
758    #[serde(
759        rename = "asyncStackTraceId",
760        default,
761        skip_serializing_if = "Option::is_none"
762    )]
763    pub async_stack_trace_id: Option<crate::protocol::runtime::StackTraceId>,
764}
765
766impl crate::typed::Command for RestartFrameParams {
767    const METHOD: &'static str = "Debugger.restartFrame";
768    type Returns = RestartFrameReturns;
769}
770
771/// Resumes JavaScript execution.
772///
773/// Parameters of `Debugger.resume`.
774#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
775pub struct ResumeParams {
776    /// Set to true to terminate execution upon resuming execution. In contrast to
777    /// Runtime.terminateExecution, this will allows to execute further JavaScript
778    /// (i.e. via evaluation) until execution of the paused code is actually
779    /// resumed, at which point termination is triggered. If execution is
780    /// currently not paused, this parameter has no effect.
781    #[serde(
782        rename = "terminateOnResume",
783        default,
784        skip_serializing_if = "Option::is_none"
785    )]
786    pub terminate_on_resume: Option<bool>,
787}
788
789impl crate::typed::Command for ResumeParams {
790    const METHOD: &'static str = "Debugger.resume";
791    type Returns = crate::typed::NoReturns;
792}
793
794/// Searches for given string in script content.
795///
796/// Parameters of `Debugger.searchInContent`.
797#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
798pub struct SearchInContentParams {
799    /// Id of the script to search in.
800    #[serde(rename = "scriptId")]
801    pub script_id: crate::protocol::runtime::ScriptId,
802    /// String to search for.
803    pub query: String,
804    /// If true, search is case sensitive.
805    #[serde(
806        rename = "caseSensitive",
807        default,
808        skip_serializing_if = "Option::is_none"
809    )]
810    pub case_sensitive: Option<bool>,
811    /// If true, treats string parameter as regex.
812    #[serde(rename = "isRegex", default, skip_serializing_if = "Option::is_none")]
813    pub is_regex: Option<bool>,
814}
815
816/// What `Debugger.searchInContent` answers with.
817#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
818pub struct SearchInContentReturns {
819    /// List of search matches.
820    pub result: Vec<SearchMatch>,
821}
822
823impl crate::typed::Command for SearchInContentParams {
824    const METHOD: &'static str = "Debugger.searchInContent";
825    type Returns = SearchInContentReturns;
826}
827
828/// Enables or disables async call stacks tracking.
829///
830/// Parameters of `Debugger.setAsyncCallStackDepth`.
831#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
832pub struct SetAsyncCallStackDepthParams {
833    /// Maximum depth of async call stacks. Setting to `0` will effectively
834    /// disable collecting async call stacks (default).
835    #[serde(rename = "maxDepth")]
836    pub max_depth: i64,
837}
838
839impl crate::typed::Command for SetAsyncCallStackDepthParams {
840    const METHOD: &'static str = "Debugger.setAsyncCallStackDepth";
841    type Returns = crate::typed::NoReturns;
842}
843
844/// Replace previous blackbox execution contexts with passed ones. Forces
845/// backend to skip stepping/pausing in scripts in these execution contexts.
846/// VM will try to leave blackboxed script by performing 'step in' several
847/// times, finally resorting to 'step out' if unsuccessful.
848///
849/// Experimental: may change without notice.
850///
851/// Parameters of `Debugger.setBlackboxExecutionContexts`.
852#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
853pub struct SetBlackboxExecutionContextsParams {
854    /// Array of execution context unique ids for the debugger to ignore.
855    #[serde(rename = "uniqueIds")]
856    pub unique_ids: Vec<String>,
857}
858
859impl crate::typed::Command for SetBlackboxExecutionContextsParams {
860    const METHOD: &'static str = "Debugger.setBlackboxExecutionContexts";
861    type Returns = crate::typed::NoReturns;
862}
863
864/// Replace previous blackbox patterns with passed ones. Forces backend to
865/// skip stepping/pausing in scripts with url matching one of the patterns. VM
866/// will try to leave blackboxed script by performing 'step in' several times,
867/// finally resorting to 'step out' if unsuccessful.
868///
869/// Experimental: may change without notice.
870///
871/// Parameters of `Debugger.setBlackboxPatterns`.
872#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
873pub struct SetBlackboxPatternsParams {
874    /// Array of regexps that will be used to check script url for blackbox state.
875    pub patterns: Vec<String>,
876    /// If true, also ignore scripts with no source url.
877    #[serde(
878        rename = "skipAnonymous",
879        default,
880        skip_serializing_if = "Option::is_none"
881    )]
882    pub skip_anonymous: Option<bool>,
883}
884
885impl crate::typed::Command for SetBlackboxPatternsParams {
886    const METHOD: &'static str = "Debugger.setBlackboxPatterns";
887    type Returns = crate::typed::NoReturns;
888}
889
890/// Makes backend skip steps in the script in blackboxed ranges. VM will try
891/// leave blacklisted scripts by performing 'step in' several times, finally
892/// resorting to 'step out' if unsuccessful. Positions array contains
893/// positions where blackbox state is changed. First interval isn't
894/// blackboxed. Array should be sorted.
895///
896/// Experimental: may change without notice.
897///
898/// Parameters of `Debugger.setBlackboxedRanges`.
899#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
900pub struct SetBlackboxedRangesParams {
901    /// Id of the script.
902    #[serde(rename = "scriptId")]
903    pub script_id: crate::protocol::runtime::ScriptId,
904    pub positions: Vec<ScriptPosition>,
905}
906
907impl crate::typed::Command for SetBlackboxedRangesParams {
908    const METHOD: &'static str = "Debugger.setBlackboxedRanges";
909    type Returns = crate::typed::NoReturns;
910}
911
912/// Sets JavaScript breakpoint at a given location.
913///
914/// Parameters of `Debugger.setBreakpoint`.
915#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
916pub struct SetBreakpointParams {
917    /// Location to set breakpoint in.
918    pub location: Location,
919    /// Expression to use as a breakpoint condition. When specified, debugger will
920    /// only stop on the breakpoint if this expression evaluates to true.
921    #[serde(default, skip_serializing_if = "Option::is_none")]
922    pub condition: Option<String>,
923}
924
925/// What `Debugger.setBreakpoint` answers with.
926#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
927pub struct SetBreakpointReturns {
928    /// Id of the created breakpoint for further reference.
929    #[serde(rename = "breakpointId")]
930    pub breakpoint_id: BreakpointId,
931    /// Location this breakpoint resolved into.
932    #[serde(rename = "actualLocation")]
933    pub actual_location: Location,
934}
935
936impl crate::typed::Command for SetBreakpointParams {
937    const METHOD: &'static str = "Debugger.setBreakpoint";
938    type Returns = SetBreakpointReturns;
939}
940
941/// Sets instrumentation breakpoint.
942///
943/// Parameters of `Debugger.setInstrumentationBreakpoint`.
944#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
945pub struct SetInstrumentationBreakpointParams {
946    /// Instrumentation name.
947    pub instrumentation: SetInstrumentationBreakpointInstrumentation,
948}
949
950/// The values `instrumentation` accepts on `setInstrumentationBreakpoint`.
951#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
952pub enum SetInstrumentationBreakpointInstrumentation {
953    /// `beforeScriptExecution`
954    #[serde(rename = "beforeScriptExecution")]
955    BeforeScriptExecution,
956    /// `beforeScriptWithSourceMapExecution`
957    #[serde(rename = "beforeScriptWithSourceMapExecution")]
958    BeforeScriptWithSourceMapExecution,
959    /// A value this vendored schema does not list. Chrome adds values ahead of
960    /// the published protocol, so an unrecognised one is kept as it arrived
961    /// rather than failing the payload it came in.
962    #[serde(untagged)]
963    Unrecognized(String),
964}
965
966/// What `Debugger.setInstrumentationBreakpoint` answers with.
967#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
968pub struct SetInstrumentationBreakpointReturns {
969    /// Id of the created breakpoint for further reference.
970    #[serde(rename = "breakpointId")]
971    pub breakpoint_id: BreakpointId,
972}
973
974impl crate::typed::Command for SetInstrumentationBreakpointParams {
975    const METHOD: &'static str = "Debugger.setInstrumentationBreakpoint";
976    type Returns = SetInstrumentationBreakpointReturns;
977}
978
979/// Sets JavaScript breakpoint at given location specified either by URL or
980/// URL regex. Once this command is issued, all existing parsed scripts will
981/// have breakpoints resolved and returned in `locations` property. Further
982/// matching script parsing will result in subsequent `breakpointResolved`
983/// events issued. This logical breakpoint will survive page reloads.
984///
985/// Parameters of `Debugger.setBreakpointByUrl`.
986#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
987pub struct SetBreakpointByUrlParams {
988    /// Line number to set breakpoint at.
989    #[serde(rename = "lineNumber")]
990    pub line_number: i64,
991    /// URL of the resources to set breakpoint on.
992    #[serde(default, skip_serializing_if = "Option::is_none")]
993    pub url: Option<String>,
994    /// Regex pattern for the URLs of the resources to set breakpoints on. Either
995    /// `url` or `urlRegex` must be specified.
996    #[serde(rename = "urlRegex", default, skip_serializing_if = "Option::is_none")]
997    pub url_regex: Option<String>,
998    /// Script hash of the resources to set breakpoint on.
999    #[serde(
1000        rename = "scriptHash",
1001        default,
1002        skip_serializing_if = "Option::is_none"
1003    )]
1004    pub script_hash: Option<String>,
1005    /// Offset in the line to set breakpoint at.
1006    #[serde(
1007        rename = "columnNumber",
1008        default,
1009        skip_serializing_if = "Option::is_none"
1010    )]
1011    pub column_number: Option<i64>,
1012    /// Expression to use as a breakpoint condition. When specified, debugger will
1013    /// only stop on the breakpoint if this expression evaluates to true.
1014    #[serde(default, skip_serializing_if = "Option::is_none")]
1015    pub condition: Option<String>,
1016}
1017
1018/// What `Debugger.setBreakpointByUrl` answers with.
1019#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1020pub struct SetBreakpointByUrlReturns {
1021    /// Id of the created breakpoint for further reference.
1022    #[serde(rename = "breakpointId")]
1023    pub breakpoint_id: BreakpointId,
1024    /// List of the locations this breakpoint resolved into upon addition.
1025    pub locations: Vec<Location>,
1026}
1027
1028impl crate::typed::Command for SetBreakpointByUrlParams {
1029    const METHOD: &'static str = "Debugger.setBreakpointByUrl";
1030    type Returns = SetBreakpointByUrlReturns;
1031}
1032
1033/// Sets JavaScript breakpoint before each call to the given function. If
1034/// another function was created from the same source as a given one, calling
1035/// it will also trigger the breakpoint.
1036///
1037/// Experimental: may change without notice.
1038///
1039/// Parameters of `Debugger.setBreakpointOnFunctionCall`.
1040#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1041pub struct SetBreakpointOnFunctionCallParams {
1042    /// Function object id.
1043    #[serde(rename = "objectId")]
1044    pub object_id: crate::protocol::runtime::RemoteObjectId,
1045    /// Expression to use as a breakpoint condition. When specified, debugger will
1046    /// stop on the breakpoint if this expression evaluates to true.
1047    #[serde(default, skip_serializing_if = "Option::is_none")]
1048    pub condition: Option<String>,
1049}
1050
1051/// What `Debugger.setBreakpointOnFunctionCall` answers with.
1052#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1053pub struct SetBreakpointOnFunctionCallReturns {
1054    /// Id of the created breakpoint for further reference.
1055    #[serde(rename = "breakpointId")]
1056    pub breakpoint_id: BreakpointId,
1057}
1058
1059impl crate::typed::Command for SetBreakpointOnFunctionCallParams {
1060    const METHOD: &'static str = "Debugger.setBreakpointOnFunctionCall";
1061    type Returns = SetBreakpointOnFunctionCallReturns;
1062}
1063
1064/// Activates / deactivates all breakpoints on the page.
1065///
1066/// Parameters of `Debugger.setBreakpointsActive`.
1067#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1068pub struct SetBreakpointsActiveParams {
1069    /// New value for breakpoints active state.
1070    pub active: bool,
1071}
1072
1073impl crate::typed::Command for SetBreakpointsActiveParams {
1074    const METHOD: &'static str = "Debugger.setBreakpointsActive";
1075    type Returns = crate::typed::NoReturns;
1076}
1077
1078/// Defines pause on exceptions state. Can be set to stop on all exceptions,
1079/// uncaught exceptions, or caught exceptions, no exceptions. Initial pause on
1080/// exceptions state is `none`.
1081///
1082/// Parameters of `Debugger.setPauseOnExceptions`.
1083#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1084pub struct SetPauseOnExceptionsParams {
1085    /// Pause on exceptions mode.
1086    pub state: SetPauseOnExceptionsState,
1087}
1088
1089/// The values `state` accepts on `setPauseOnExceptions`.
1090#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1091pub enum SetPauseOnExceptionsState {
1092    /// `none`
1093    #[serde(rename = "none")]
1094    None,
1095    /// `caught`
1096    #[serde(rename = "caught")]
1097    Caught,
1098    /// `uncaught`
1099    #[serde(rename = "uncaught")]
1100    Uncaught,
1101    /// `all`
1102    #[serde(rename = "all")]
1103    All,
1104    /// A value this vendored schema does not list. Chrome adds values ahead of
1105    /// the published protocol, so an unrecognised one is kept as it arrived
1106    /// rather than failing the payload it came in.
1107    #[serde(untagged)]
1108    Unrecognized(String),
1109}
1110
1111impl crate::typed::Command for SetPauseOnExceptionsParams {
1112    const METHOD: &'static str = "Debugger.setPauseOnExceptions";
1113    type Returns = crate::typed::NoReturns;
1114}
1115
1116/// Changes return value in top frame. Available only at return break
1117/// position.
1118///
1119/// Experimental: may change without notice.
1120///
1121/// Parameters of `Debugger.setReturnValue`.
1122#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1123pub struct SetReturnValueParams {
1124    /// New return value.
1125    #[serde(rename = "newValue")]
1126    pub new_value: crate::protocol::runtime::CallArgument,
1127}
1128
1129impl crate::typed::Command for SetReturnValueParams {
1130    const METHOD: &'static str = "Debugger.setReturnValue";
1131    type Returns = crate::typed::NoReturns;
1132}
1133
1134/// Live edit is no longer supported and this command always fails with a "no
1135/// longer available" error.
1136///
1137/// Deprecated in the protocol.
1138///
1139/// Parameters of `Debugger.setScriptSource`.
1140#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1141pub struct SetScriptSourceParams {
1142    /// Id of the script to edit.
1143    #[serde(rename = "scriptId")]
1144    pub script_id: crate::protocol::runtime::ScriptId,
1145    /// New content of the script.
1146    #[serde(rename = "scriptSource")]
1147    pub script_source: String,
1148    /// If true the change will not actually be applied. Dry run may be used to
1149    /// get result description without actually modifying the code.
1150    #[serde(rename = "dryRun", default, skip_serializing_if = "Option::is_none")]
1151    pub dry_run: Option<bool>,
1152    /// If true, then `scriptSource` is allowed to change the function on top of
1153    /// the stack as long as the top-most stack frame is the only activation of
1154    /// that function.
1155    ///
1156    /// Experimental: may change without notice.
1157    #[serde(
1158        rename = "allowTopFrameEditing",
1159        default,
1160        skip_serializing_if = "Option::is_none"
1161    )]
1162    pub allow_top_frame_editing: Option<bool>,
1163}
1164
1165/// What `Debugger.setScriptSource` answers with.
1166#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1167pub struct SetScriptSourceReturns {
1168    /// New stack trace in case editing has happened while VM was stopped.
1169    ///
1170    /// Deprecated in the protocol.
1171    #[serde(
1172        rename = "callFrames",
1173        default,
1174        skip_serializing_if = "Option::is_none"
1175    )]
1176    pub call_frames: Option<Vec<CallFrame>>,
1177    /// Whether current call stack was modified after applying the changes.
1178    ///
1179    /// Deprecated in the protocol.
1180    #[serde(
1181        rename = "stackChanged",
1182        default,
1183        skip_serializing_if = "Option::is_none"
1184    )]
1185    pub stack_changed: Option<bool>,
1186    /// Async stack trace, if any.
1187    ///
1188    /// Deprecated in the protocol.
1189    #[serde(
1190        rename = "asyncStackTrace",
1191        default,
1192        skip_serializing_if = "Option::is_none"
1193    )]
1194    pub async_stack_trace: Option<crate::protocol::runtime::StackTrace>,
1195    /// Async stack trace, if any.
1196    ///
1197    /// Deprecated in the protocol.
1198    #[serde(
1199        rename = "asyncStackTraceId",
1200        default,
1201        skip_serializing_if = "Option::is_none"
1202    )]
1203    pub async_stack_trace_id: Option<crate::protocol::runtime::StackTraceId>,
1204    /// Whether the operation was successful or not. Only `Ok` denotes a
1205    /// successful live edit while the other enum variants denote why the live
1206    /// edit failed.
1207    ///
1208    /// Experimental: may change without notice.
1209    pub status: SetScriptSourceStatus,
1210    /// Exception details if any. Only present when `status` is `CompileError`.
1211    #[serde(
1212        rename = "exceptionDetails",
1213        default,
1214        skip_serializing_if = "Option::is_none"
1215    )]
1216    pub exception_details: Option<crate::protocol::runtime::ExceptionDetails>,
1217}
1218
1219/// The values `status` accepts on `setScriptSource`.
1220#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1221pub enum SetScriptSourceStatus {
1222    /// `Ok`
1223    Ok,
1224    /// `CompileError`
1225    CompileError,
1226    /// `BlockedByActiveGenerator`
1227    BlockedByActiveGenerator,
1228    /// `BlockedByActiveFunction`
1229    BlockedByActiveFunction,
1230    /// `BlockedByTopLevelEsModuleChange`
1231    BlockedByTopLevelEsModuleChange,
1232    /// A value this vendored schema does not list. Chrome adds values ahead of
1233    /// the published protocol, so an unrecognised one is kept as it arrived
1234    /// rather than failing the payload it came in.
1235    #[serde(untagged)]
1236    Unrecognized(String),
1237}
1238
1239impl crate::typed::Command for SetScriptSourceParams {
1240    const METHOD: &'static str = "Debugger.setScriptSource";
1241    type Returns = SetScriptSourceReturns;
1242}
1243
1244/// Makes page not interrupt on any pauses (breakpoint, exception, dom
1245/// exception etc).
1246///
1247/// Parameters of `Debugger.setSkipAllPauses`.
1248#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1249pub struct SetSkipAllPausesParams {
1250    /// New value for skip pauses state.
1251    pub skip: bool,
1252}
1253
1254impl crate::typed::Command for SetSkipAllPausesParams {
1255    const METHOD: &'static str = "Debugger.setSkipAllPauses";
1256    type Returns = crate::typed::NoReturns;
1257}
1258
1259/// Changes value of variable in a callframe. Object-based scopes are not
1260/// supported and must be mutated manually.
1261///
1262/// Parameters of `Debugger.setVariableValue`.
1263#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1264pub struct SetVariableValueParams {
1265    /// 0-based number of scope as was listed in scope chain. Only 'local',
1266    /// 'closure' and 'catch' scope types are allowed. Other scopes could be
1267    /// manipulated manually.
1268    #[serde(rename = "scopeNumber")]
1269    pub scope_number: i64,
1270    /// Variable name.
1271    #[serde(rename = "variableName")]
1272    pub variable_name: String,
1273    /// New variable value.
1274    #[serde(rename = "newValue")]
1275    pub new_value: crate::protocol::runtime::CallArgument,
1276    /// Id of callframe that holds variable.
1277    #[serde(rename = "callFrameId")]
1278    pub call_frame_id: CallFrameId,
1279}
1280
1281impl crate::typed::Command for SetVariableValueParams {
1282    const METHOD: &'static str = "Debugger.setVariableValue";
1283    type Returns = crate::typed::NoReturns;
1284}
1285
1286/// Steps into the function call.
1287///
1288/// Parameters of `Debugger.stepInto`.
1289#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1290pub struct StepIntoParams {
1291    /// Debugger will pause on the execution of the first async task which was
1292    /// scheduled before next pause.
1293    ///
1294    /// Experimental: may change without notice.
1295    #[serde(
1296        rename = "breakOnAsyncCall",
1297        default,
1298        skip_serializing_if = "Option::is_none"
1299    )]
1300    pub break_on_async_call: Option<bool>,
1301    /// The skipList specifies location ranges that should be skipped on step
1302    /// into.
1303    ///
1304    /// Experimental: may change without notice.
1305    #[serde(rename = "skipList", default, skip_serializing_if = "Option::is_none")]
1306    pub skip_list: Option<Vec<LocationRange>>,
1307}
1308
1309impl crate::typed::Command for StepIntoParams {
1310    const METHOD: &'static str = "Debugger.stepInto";
1311    type Returns = crate::typed::NoReturns;
1312}
1313
1314/// Steps out of the function call.
1315///
1316/// Parameters of `Debugger.stepOut`.
1317#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1318pub struct StepOutParams {}
1319
1320impl crate::typed::Command for StepOutParams {
1321    const METHOD: &'static str = "Debugger.stepOut";
1322    type Returns = crate::typed::NoReturns;
1323}
1324
1325/// Steps over the statement.
1326///
1327/// Parameters of `Debugger.stepOver`.
1328#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1329pub struct StepOverParams {
1330    /// The skipList specifies location ranges that should be skipped on step
1331    /// over.
1332    ///
1333    /// Experimental: may change without notice.
1334    #[serde(rename = "skipList", default, skip_serializing_if = "Option::is_none")]
1335    pub skip_list: Option<Vec<LocationRange>>,
1336    /// Functions whose source range lies within one of the enterRanges are
1337    /// entered as if by stepInto, even when they are called (directly or
1338    /// indirectly) from a call that is stepped over.
1339    ///
1340    /// Experimental: may change without notice.
1341    #[serde(
1342        rename = "enterRanges",
1343        default,
1344        skip_serializing_if = "Option::is_none"
1345    )]
1346    pub enter_ranges: Option<Vec<LocationRange>>,
1347}
1348
1349impl crate::typed::Command for StepOverParams {
1350    const METHOD: &'static str = "Debugger.stepOver";
1351    type Returns = crate::typed::NoReturns;
1352}
1353
1354/// Fired when breakpoint is resolved to an actual script and location.
1355/// Deprecated in favor of `resolvedBreakpoints` in the `scriptParsed` event.
1356///
1357/// Deprecated in the protocol.
1358///
1359/// Payload of the `Debugger.breakpointResolved` event.
1360#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1361pub struct BreakpointResolvedEvent {
1362    /// Breakpoint unique identifier.
1363    #[serde(rename = "breakpointId")]
1364    pub breakpoint_id: BreakpointId,
1365    /// Actual breakpoint location.
1366    pub location: Location,
1367}
1368
1369impl crate::typed::Event for BreakpointResolvedEvent {
1370    const METHOD: &'static str = "Debugger.breakpointResolved";
1371}
1372
1373/// Fired when the virtual machine stopped on breakpoint or exception or any
1374/// other stop criteria.
1375///
1376/// Payload of the `Debugger.paused` event.
1377#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1378pub struct PausedEvent {
1379    /// Call stack the virtual machine stopped on.
1380    #[serde(rename = "callFrames")]
1381    pub call_frames: Vec<CallFrame>,
1382    /// Pause reason.
1383    pub reason: PausedReason,
1384    /// Object containing break-specific auxiliary properties.
1385    #[serde(default, skip_serializing_if = "Option::is_none")]
1386    pub data: Option<serde_json::Value>,
1387    /// Hit breakpoints IDs
1388    #[serde(
1389        rename = "hitBreakpoints",
1390        default,
1391        skip_serializing_if = "Option::is_none"
1392    )]
1393    pub hit_breakpoints: Option<Vec<String>>,
1394    /// Async stack trace, if any.
1395    #[serde(
1396        rename = "asyncStackTrace",
1397        default,
1398        skip_serializing_if = "Option::is_none"
1399    )]
1400    pub async_stack_trace: Option<crate::protocol::runtime::StackTrace>,
1401    /// Async stack trace, if any.
1402    ///
1403    /// Experimental: may change without notice.
1404    #[serde(
1405        rename = "asyncStackTraceId",
1406        default,
1407        skip_serializing_if = "Option::is_none"
1408    )]
1409    pub async_stack_trace_id: Option<crate::protocol::runtime::StackTraceId>,
1410    /// Never present, will be removed.
1411    ///
1412    /// Deprecated in the protocol.
1413    ///
1414    /// Experimental: may change without notice.
1415    #[serde(
1416        rename = "asyncCallStackTraceId",
1417        default,
1418        skip_serializing_if = "Option::is_none"
1419    )]
1420    pub async_call_stack_trace_id: Option<crate::protocol::runtime::StackTraceId>,
1421}
1422
1423/// The values `reason` accepts on `paused`.
1424#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1425pub enum PausedReason {
1426    /// `ambiguous`
1427    #[serde(rename = "ambiguous")]
1428    Ambiguous,
1429    /// `assert`
1430    #[serde(rename = "assert")]
1431    Assert,
1432    /// `CSPViolation`
1433    #[serde(rename = "CSPViolation")]
1434    CspViolation,
1435    /// `debugCommand`
1436    #[serde(rename = "debugCommand")]
1437    DebugCommand,
1438    /// `DOM`
1439    #[serde(rename = "DOM")]
1440    Dom,
1441    /// `EventListener`
1442    EventListener,
1443    /// `exception`
1444    #[serde(rename = "exception")]
1445    Exception,
1446    /// `instrumentation`
1447    #[serde(rename = "instrumentation")]
1448    Instrumentation,
1449    /// `OOM`
1450    #[serde(rename = "OOM")]
1451    Oom,
1452    /// `other`
1453    #[serde(rename = "other")]
1454    Other,
1455    /// `promiseRejection`
1456    #[serde(rename = "promiseRejection")]
1457    PromiseRejection,
1458    /// `XHR`
1459    #[serde(rename = "XHR")]
1460    Xhr,
1461    /// `step`
1462    #[serde(rename = "step")]
1463    Step,
1464    /// A value this vendored schema does not list. Chrome adds values ahead of
1465    /// the published protocol, so an unrecognised one is kept as it arrived
1466    /// rather than failing the payload it came in.
1467    #[serde(untagged)]
1468    Unrecognized(String),
1469}
1470
1471impl crate::typed::Event for PausedEvent {
1472    const METHOD: &'static str = "Debugger.paused";
1473}
1474
1475/// Fired when the virtual machine resumed execution.
1476///
1477/// Payload of the `Debugger.resumed` event.
1478#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1479pub struct ResumedEvent {}
1480
1481impl crate::typed::Event for ResumedEvent {
1482    const METHOD: &'static str = "Debugger.resumed";
1483}
1484
1485/// Fired when virtual machine fails to parse the script.
1486///
1487/// Payload of the `Debugger.scriptFailedToParse` event.
1488#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1489pub struct ScriptFailedToParseEvent {
1490    /// Identifier of the script parsed.
1491    #[serde(rename = "scriptId")]
1492    pub script_id: crate::protocol::runtime::ScriptId,
1493    /// URL or name of the script parsed (if any).
1494    pub url: String,
1495    /// Line offset of the script within the resource with given URL (for script
1496    /// tags).
1497    #[serde(rename = "startLine")]
1498    pub start_line: i64,
1499    /// Column offset of the script within the resource with given URL.
1500    #[serde(rename = "startColumn")]
1501    pub start_column: i64,
1502    /// Last line of the script.
1503    #[serde(rename = "endLine")]
1504    pub end_line: i64,
1505    /// Length of the last line of the script.
1506    #[serde(rename = "endColumn")]
1507    pub end_column: i64,
1508    /// Specifies script creation context.
1509    #[serde(rename = "executionContextId")]
1510    pub execution_context_id: crate::protocol::runtime::ExecutionContextId,
1511    /// Content hash of the script, SHA-256.
1512    pub hash: String,
1513    /// For Wasm modules, the content of the `build_id` custom section. For
1514    /// JavaScript the `debugId` magic comment.
1515    #[serde(rename = "buildId")]
1516    pub build_id: String,
1517    /// Embedder-specific auxiliary data likely matching {isDefault: boolean,
1518    /// type: 'default'|'isolated'|'worker', frameId: string}
1519    #[serde(
1520        rename = "executionContextAuxData",
1521        default,
1522        skip_serializing_if = "Option::is_none"
1523    )]
1524    pub execution_context_aux_data: Option<serde_json::Value>,
1525    /// URL of source map associated with script (if any).
1526    #[serde(
1527        rename = "sourceMapURL",
1528        default,
1529        skip_serializing_if = "Option::is_none"
1530    )]
1531    pub source_map_url: Option<String>,
1532    /// True, if this script has sourceURL.
1533    #[serde(
1534        rename = "hasSourceURL",
1535        default,
1536        skip_serializing_if = "Option::is_none"
1537    )]
1538    pub has_source_url: Option<bool>,
1539    /// True, if this script is ES6 module.
1540    #[serde(rename = "isModule", default, skip_serializing_if = "Option::is_none")]
1541    pub is_module: Option<bool>,
1542    /// This script length.
1543    #[serde(default, skip_serializing_if = "Option::is_none")]
1544    pub length: Option<i64>,
1545    /// JavaScript top stack frame of where the script parsed event was triggered
1546    /// if available.
1547    ///
1548    /// Experimental: may change without notice.
1549    #[serde(
1550        rename = "stackTrace",
1551        default,
1552        skip_serializing_if = "Option::is_none"
1553    )]
1554    pub stack_trace: Option<crate::protocol::runtime::StackTrace>,
1555    /// If the scriptLanguage is WebAssembly, the code section offset in the
1556    /// module.
1557    ///
1558    /// Experimental: may change without notice.
1559    #[serde(
1560        rename = "codeOffset",
1561        default,
1562        skip_serializing_if = "Option::is_none"
1563    )]
1564    pub code_offset: Option<i64>,
1565    /// The language of the script.
1566    ///
1567    /// Experimental: may change without notice.
1568    #[serde(
1569        rename = "scriptLanguage",
1570        default,
1571        skip_serializing_if = "Option::is_none"
1572    )]
1573    pub script_language: Option<ScriptLanguage>,
1574    /// The name the embedder supplied for this script.
1575    ///
1576    /// Experimental: may change without notice.
1577    #[serde(
1578        rename = "embedderName",
1579        default,
1580        skip_serializing_if = "Option::is_none"
1581    )]
1582    pub embedder_name: Option<String>,
1583}
1584
1585impl crate::typed::Event for ScriptFailedToParseEvent {
1586    const METHOD: &'static str = "Debugger.scriptFailedToParse";
1587}
1588
1589/// Fired when virtual machine parses script. This event is also fired for all
1590/// known and uncollected scripts upon enabling debugger.
1591///
1592/// Payload of the `Debugger.scriptParsed` event.
1593#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1594pub struct ScriptParsedEvent {
1595    /// Identifier of the script parsed.
1596    #[serde(rename = "scriptId")]
1597    pub script_id: crate::protocol::runtime::ScriptId,
1598    /// URL or name of the script parsed (if any).
1599    pub url: String,
1600    /// Line offset of the script within the resource with given URL (for script
1601    /// tags).
1602    #[serde(rename = "startLine")]
1603    pub start_line: i64,
1604    /// Column offset of the script within the resource with given URL.
1605    #[serde(rename = "startColumn")]
1606    pub start_column: i64,
1607    /// Last line of the script.
1608    #[serde(rename = "endLine")]
1609    pub end_line: i64,
1610    /// Length of the last line of the script.
1611    #[serde(rename = "endColumn")]
1612    pub end_column: i64,
1613    /// Specifies script creation context.
1614    #[serde(rename = "executionContextId")]
1615    pub execution_context_id: crate::protocol::runtime::ExecutionContextId,
1616    /// Content hash of the script, SHA-256.
1617    pub hash: String,
1618    /// For Wasm modules, the content of the `build_id` custom section. For
1619    /// JavaScript the `debugId` magic comment.
1620    #[serde(rename = "buildId")]
1621    pub build_id: String,
1622    /// Embedder-specific auxiliary data likely matching {isDefault: boolean,
1623    /// type: 'default'|'isolated'|'worker', frameId: string}
1624    #[serde(
1625        rename = "executionContextAuxData",
1626        default,
1627        skip_serializing_if = "Option::is_none"
1628    )]
1629    pub execution_context_aux_data: Option<serde_json::Value>,
1630    /// True, if this script is generated as a result of the live edit operation.
1631    ///
1632    /// Experimental: may change without notice.
1633    #[serde(
1634        rename = "isLiveEdit",
1635        default,
1636        skip_serializing_if = "Option::is_none"
1637    )]
1638    pub is_live_edit: Option<bool>,
1639    /// URL of source map associated with script (if any).
1640    #[serde(
1641        rename = "sourceMapURL",
1642        default,
1643        skip_serializing_if = "Option::is_none"
1644    )]
1645    pub source_map_url: Option<String>,
1646    /// True, if this script has sourceURL.
1647    #[serde(
1648        rename = "hasSourceURL",
1649        default,
1650        skip_serializing_if = "Option::is_none"
1651    )]
1652    pub has_source_url: Option<bool>,
1653    /// True, if this script is ES6 module.
1654    #[serde(rename = "isModule", default, skip_serializing_if = "Option::is_none")]
1655    pub is_module: Option<bool>,
1656    /// This script length.
1657    #[serde(default, skip_serializing_if = "Option::is_none")]
1658    pub length: Option<i64>,
1659    /// JavaScript top stack frame of where the script parsed event was triggered
1660    /// if available.
1661    ///
1662    /// Experimental: may change without notice.
1663    #[serde(
1664        rename = "stackTrace",
1665        default,
1666        skip_serializing_if = "Option::is_none"
1667    )]
1668    pub stack_trace: Option<crate::protocol::runtime::StackTrace>,
1669    /// If the scriptLanguage is WebAssembly, the code section offset in the
1670    /// module.
1671    ///
1672    /// Experimental: may change without notice.
1673    #[serde(
1674        rename = "codeOffset",
1675        default,
1676        skip_serializing_if = "Option::is_none"
1677    )]
1678    pub code_offset: Option<i64>,
1679    /// The language of the script.
1680    ///
1681    /// Experimental: may change without notice.
1682    #[serde(
1683        rename = "scriptLanguage",
1684        default,
1685        skip_serializing_if = "Option::is_none"
1686    )]
1687    pub script_language: Option<ScriptLanguage>,
1688    /// If the scriptLanguage is WebAssembly, the source of debug symbols for the
1689    /// module.
1690    ///
1691    /// Experimental: may change without notice.
1692    #[serde(
1693        rename = "debugSymbols",
1694        default,
1695        skip_serializing_if = "Option::is_none"
1696    )]
1697    pub debug_symbols: Option<Vec<DebugSymbols>>,
1698    /// The name the embedder supplied for this script.
1699    ///
1700    /// Experimental: may change without notice.
1701    #[serde(
1702        rename = "embedderName",
1703        default,
1704        skip_serializing_if = "Option::is_none"
1705    )]
1706    pub embedder_name: Option<String>,
1707    /// The list of set breakpoints in this script if calls to
1708    /// `setBreakpointByUrl` matches this script's URL or hash. Clients that use
1709    /// this list can ignore the `breakpointResolved` event. They are equivalent.
1710    ///
1711    /// Experimental: may change without notice.
1712    #[serde(
1713        rename = "resolvedBreakpoints",
1714        default,
1715        skip_serializing_if = "Option::is_none"
1716    )]
1717    pub resolved_breakpoints: Option<Vec<ResolvedBreakpoint>>,
1718}
1719
1720impl crate::typed::Event for ScriptParsedEvent {
1721    const METHOD: &'static str = "Debugger.scriptParsed";
1722}