Skip to main content

js_protocol/debugger/
mod.rs

1//! Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing
2//! breakpoints, stepping through execution, exploring stack traces, etc.
3
4
5use serde::{Serialize, Deserialize};
6use serde_json::Value as JsonValue;
7use std::borrow::Cow;
8
9/// Breakpoint identifier.
10
11pub type BreakpointId<'a> = Cow<'a, str>;
12
13/// Call frame identifier.
14
15pub type CallFrameId<'a> = Cow<'a, str>;
16
17/// Location in the source code.
18
19#[derive(Debug, Clone, Serialize, Deserialize, Default)]
20#[serde(rename_all = "camelCase")]
21pub struct Location<'a> {
22    /// Script identifier as reported in the 'Debugger.scriptParsed'.
23    #[serde(rename = "scriptId")]
24    script_id: crate::runtime::ScriptId<'a>,
25    /// Line number in the script (0-based).
26    #[serde(rename = "lineNumber")]
27    line_number: i64,
28    /// Column number in the script (0-based).
29    #[serde(skip_serializing_if = "Option::is_none", rename = "columnNumber")]
30    column_number: Option<i64>,
31}
32
33impl<'a> Location<'a> {
34    /// Creates a builder for this type with the required parameters:
35    /// * `script_id`: Script identifier as reported in the `Debugger.scriptParsed`.
36    /// * `line_number`: Line number in the script (0-based).
37    pub fn builder(script_id: crate::runtime::ScriptId<'a>, line_number: i64) -> LocationBuilder<'a> {
38        LocationBuilder {
39            script_id: script_id,
40            line_number: line_number,
41            column_number: None,
42        }
43    }
44    /// Script identifier as reported in the 'Debugger.scriptParsed'.
45    pub fn script_id(&self) -> &crate::runtime::ScriptId<'a> { &self.script_id }
46    /// Line number in the script (0-based).
47    pub fn line_number(&self) -> i64 { self.line_number }
48    /// Column number in the script (0-based).
49    pub fn column_number(&self) -> Option<i64> { self.column_number }
50}
51
52
53pub struct LocationBuilder<'a> {
54    script_id: crate::runtime::ScriptId<'a>,
55    line_number: i64,
56    column_number: Option<i64>,
57}
58
59impl<'a> LocationBuilder<'a> {
60    /// Column number in the script (0-based).
61    pub fn column_number(mut self, column_number: i64) -> Self { self.column_number = Some(column_number); self }
62    pub fn build(self) -> Location<'a> {
63        Location {
64            script_id: self.script_id,
65            line_number: self.line_number,
66            column_number: self.column_number,
67        }
68    }
69}
70
71/// Location in the source code.
72
73#[derive(Debug, Clone, Serialize, Deserialize, Default)]
74#[serde(rename_all = "camelCase")]
75pub struct ScriptPosition {
76    #[serde(rename = "lineNumber")]
77    line_number: i64,
78    #[serde(rename = "columnNumber")]
79    column_number: i64,
80}
81
82impl ScriptPosition {
83    /// Creates a builder for this type with the required parameters:
84    /// * `line_number`: 
85    /// * `column_number`: 
86    pub fn builder(line_number: i64, column_number: i64) -> ScriptPositionBuilder {
87        ScriptPositionBuilder {
88            line_number: line_number,
89            column_number: column_number,
90        }
91    }
92    pub fn line_number(&self) -> i64 { self.line_number }
93    pub fn column_number(&self) -> i64 { self.column_number }
94}
95
96
97pub struct ScriptPositionBuilder {
98    line_number: i64,
99    column_number: i64,
100}
101
102impl ScriptPositionBuilder {
103    pub fn build(self) -> ScriptPosition {
104        ScriptPosition {
105            line_number: self.line_number,
106            column_number: self.column_number,
107        }
108    }
109}
110
111/// Location range within one script.
112
113#[derive(Debug, Clone, Serialize, Deserialize, Default)]
114#[serde(rename_all = "camelCase")]
115pub struct LocationRange<'a> {
116    #[serde(rename = "scriptId")]
117    script_id: crate::runtime::ScriptId<'a>,
118    start: ScriptPosition,
119    end: ScriptPosition,
120}
121
122impl<'a> LocationRange<'a> {
123    /// Creates a builder for this type with the required parameters:
124    /// * `script_id`: 
125    /// * `start`: 
126    /// * `end`: 
127    pub fn builder(script_id: crate::runtime::ScriptId<'a>, start: ScriptPosition, end: ScriptPosition) -> LocationRangeBuilder<'a> {
128        LocationRangeBuilder {
129            script_id: script_id,
130            start: start,
131            end: end,
132        }
133    }
134    pub fn script_id(&self) -> &crate::runtime::ScriptId<'a> { &self.script_id }
135    pub fn start(&self) -> &ScriptPosition { &self.start }
136    pub fn end(&self) -> &ScriptPosition { &self.end }
137}
138
139
140pub struct LocationRangeBuilder<'a> {
141    script_id: crate::runtime::ScriptId<'a>,
142    start: ScriptPosition,
143    end: ScriptPosition,
144}
145
146impl<'a> LocationRangeBuilder<'a> {
147    pub fn build(self) -> LocationRange<'a> {
148        LocationRange {
149            script_id: self.script_id,
150            start: self.start,
151            end: self.end,
152        }
153    }
154}
155
156/// JavaScript call frame. Array of call frames form the call stack.
157
158#[derive(Debug, Clone, Serialize, Deserialize, Default)]
159#[serde(rename_all = "camelCase")]
160pub struct CallFrame<'a> {
161    /// Call frame identifier. This identifier is only valid while the virtual machine is paused.
162    #[serde(rename = "callFrameId")]
163    call_frame_id: CallFrameId<'a>,
164    /// Name of the JavaScript function called on this call frame.
165    #[serde(rename = "functionName")]
166    function_name: Cow<'a, str>,
167    /// Location in the source code.
168    #[serde(skip_serializing_if = "Option::is_none", rename = "functionLocation")]
169    function_location: Option<Location<'a>>,
170    /// Location in the source code.
171    location: Location<'a>,
172    /// JavaScript script name or url.
173    /// Deprecated in favor of using the 'location.scriptId' to resolve the URL via a previously
174    /// sent 'Debugger.scriptParsed' event.
175    url: Cow<'a, str>,
176    /// Scope chain for this call frame.
177    #[serde(rename = "scopeChain")]
178    scope_chain: Vec<Scope<'a>>,
179    /// 'this' object for this call frame.
180    this: crate::runtime::RemoteObject<'a>,
181    /// The value being returned, if the function is at return point.
182    #[serde(skip_serializing_if = "Option::is_none", rename = "returnValue")]
183    return_value: Option<crate::runtime::RemoteObject<'a>>,
184    /// Valid only while the VM is paused and indicates whether this frame
185    /// can be restarted or not. Note that a 'true' value here does not
186    /// guarantee that Debugger#restartFrame with this CallFrameId will be
187    /// successful, but it is very likely.
188    #[serde(skip_serializing_if = "Option::is_none", rename = "canBeRestarted")]
189    can_be_restarted: Option<bool>,
190}
191
192impl<'a> CallFrame<'a> {
193    /// Creates a builder for this type with the required parameters:
194    /// * `call_frame_id`: Call frame identifier. This identifier is only valid while the virtual machine is paused.
195    /// * `function_name`: Name of the JavaScript function called on this call frame.
196    /// * `location`: Location in the source code.
197    /// * `url`: JavaScript script name or url. Deprecated in favor of using the `location.scriptId` to resolve the URL via a previously sent `Debugger.scriptParsed` event.
198    /// * `scope_chain`: Scope chain for this call frame.
199    /// * `this`: `this` object for this call frame.
200    pub fn builder(call_frame_id: impl Into<CallFrameId<'a>>, function_name: impl Into<Cow<'a, str>>, location: Location<'a>, url: impl Into<Cow<'a, str>>, scope_chain: Vec<Scope<'a>>, this: crate::runtime::RemoteObject<'a>) -> CallFrameBuilder<'a> {
201        CallFrameBuilder {
202            call_frame_id: call_frame_id.into(),
203            function_name: function_name.into(),
204            function_location: None,
205            location: location,
206            url: url.into(),
207            scope_chain: scope_chain,
208            this: this,
209            return_value: None,
210            can_be_restarted: None,
211        }
212    }
213    /// Call frame identifier. This identifier is only valid while the virtual machine is paused.
214    pub fn call_frame_id(&self) -> &CallFrameId<'a> { &self.call_frame_id }
215    /// Name of the JavaScript function called on this call frame.
216    pub fn function_name(&self) -> &str { self.function_name.as_ref() }
217    /// Location in the source code.
218    pub fn function_location(&self) -> Option<&Location<'a>> { self.function_location.as_ref() }
219    /// Location in the source code.
220    pub fn location(&self) -> &Location<'a> { &self.location }
221    /// JavaScript script name or url.
222    /// Deprecated in favor of using the 'location.scriptId' to resolve the URL via a previously
223    /// sent 'Debugger.scriptParsed' event.
224    pub fn url(&self) -> &str { self.url.as_ref() }
225    /// Scope chain for this call frame.
226    pub fn scope_chain(&self) -> &[Scope<'a>] { &self.scope_chain }
227    /// 'this' object for this call frame.
228    pub fn this(&self) -> &crate::runtime::RemoteObject<'a> { &self.this }
229    /// The value being returned, if the function is at return point.
230    pub fn return_value(&self) -> Option<&crate::runtime::RemoteObject<'a>> { self.return_value.as_ref() }
231    /// Valid only while the VM is paused and indicates whether this frame
232    /// can be restarted or not. Note that a 'true' value here does not
233    /// guarantee that Debugger#restartFrame with this CallFrameId will be
234    /// successful, but it is very likely.
235    pub fn can_be_restarted(&self) -> Option<bool> { self.can_be_restarted }
236}
237
238
239pub struct CallFrameBuilder<'a> {
240    call_frame_id: CallFrameId<'a>,
241    function_name: Cow<'a, str>,
242    function_location: Option<Location<'a>>,
243    location: Location<'a>,
244    url: Cow<'a, str>,
245    scope_chain: Vec<Scope<'a>>,
246    this: crate::runtime::RemoteObject<'a>,
247    return_value: Option<crate::runtime::RemoteObject<'a>>,
248    can_be_restarted: Option<bool>,
249}
250
251impl<'a> CallFrameBuilder<'a> {
252    /// Location in the source code.
253    pub fn function_location(mut self, function_location: Location<'a>) -> Self { self.function_location = Some(function_location); self }
254    /// The value being returned, if the function is at return point.
255    pub fn return_value(mut self, return_value: crate::runtime::RemoteObject<'a>) -> Self { self.return_value = Some(return_value); self }
256    /// Valid only while the VM is paused and indicates whether this frame
257    /// can be restarted or not. Note that a 'true' value here does not
258    /// guarantee that Debugger#restartFrame with this CallFrameId will be
259    /// successful, but it is very likely.
260    pub fn can_be_restarted(mut self, can_be_restarted: bool) -> Self { self.can_be_restarted = Some(can_be_restarted); self }
261    pub fn build(self) -> CallFrame<'a> {
262        CallFrame {
263            call_frame_id: self.call_frame_id,
264            function_name: self.function_name,
265            function_location: self.function_location,
266            location: self.location,
267            url: self.url,
268            scope_chain: self.scope_chain,
269            this: self.this,
270            return_value: self.return_value,
271            can_be_restarted: self.can_be_restarted,
272        }
273    }
274}
275
276/// Scope description.
277
278#[derive(Debug, Clone, Serialize, Deserialize, Default)]
279#[serde(rename_all = "camelCase")]
280pub struct Scope<'a> {
281    /// Scope type.
282    #[serde(rename = "type")]
283    type_: Cow<'a, str>,
284    /// Object representing the scope. For 'global' and 'with' scopes it represents the actual
285    /// object; for the rest of the scopes, it is artificial transient object enumerating scope
286    /// variables as its properties.
287    object: crate::runtime::RemoteObject<'a>,
288    #[serde(skip_serializing_if = "Option::is_none")]
289    name: Option<Cow<'a, str>>,
290    /// Location in the source code where scope starts
291    #[serde(skip_serializing_if = "Option::is_none", rename = "startLocation")]
292    start_location: Option<Location<'a>>,
293    /// Location in the source code where scope ends
294    #[serde(skip_serializing_if = "Option::is_none", rename = "endLocation")]
295    end_location: Option<Location<'a>>,
296}
297
298impl<'a> Scope<'a> {
299    /// Creates a builder for this type with the required parameters:
300    /// * `type_`: Scope type.
301    /// * `object`: Object representing the scope. For `global` and `with` scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties.
302    pub fn builder(type_: impl Into<Cow<'a, str>>, object: crate::runtime::RemoteObject<'a>) -> ScopeBuilder<'a> {
303        ScopeBuilder {
304            type_: type_.into(),
305            object: object,
306            name: None,
307            start_location: None,
308            end_location: None,
309        }
310    }
311    /// Scope type.
312    pub fn type_(&self) -> &str { self.type_.as_ref() }
313    /// Object representing the scope. For 'global' and 'with' scopes it represents the actual
314    /// object; for the rest of the scopes, it is artificial transient object enumerating scope
315    /// variables as its properties.
316    pub fn object(&self) -> &crate::runtime::RemoteObject<'a> { &self.object }
317    pub fn name(&self) -> Option<&str> { self.name.as_deref() }
318    /// Location in the source code where scope starts
319    pub fn start_location(&self) -> Option<&Location<'a>> { self.start_location.as_ref() }
320    /// Location in the source code where scope ends
321    pub fn end_location(&self) -> Option<&Location<'a>> { self.end_location.as_ref() }
322}
323
324
325pub struct ScopeBuilder<'a> {
326    type_: Cow<'a, str>,
327    object: crate::runtime::RemoteObject<'a>,
328    name: Option<Cow<'a, str>>,
329    start_location: Option<Location<'a>>,
330    end_location: Option<Location<'a>>,
331}
332
333impl<'a> ScopeBuilder<'a> {
334    pub fn name(mut self, name: impl Into<Cow<'a, str>>) -> Self { self.name = Some(name.into()); self }
335    /// Location in the source code where scope starts
336    pub fn start_location(mut self, start_location: Location<'a>) -> Self { self.start_location = Some(start_location); self }
337    /// Location in the source code where scope ends
338    pub fn end_location(mut self, end_location: Location<'a>) -> Self { self.end_location = Some(end_location); self }
339    pub fn build(self) -> Scope<'a> {
340        Scope {
341            type_: self.type_,
342            object: self.object,
343            name: self.name,
344            start_location: self.start_location,
345            end_location: self.end_location,
346        }
347    }
348}
349
350/// Search match for resource.
351
352#[derive(Debug, Clone, Serialize, Deserialize, Default)]
353#[serde(rename_all = "camelCase")]
354pub struct SearchMatch<'a> {
355    /// Line number in resource content.
356    #[serde(rename = "lineNumber")]
357    line_number: f64,
358    /// Line with match content.
359    #[serde(rename = "lineContent")]
360    line_content: Cow<'a, str>,
361}
362
363impl<'a> SearchMatch<'a> {
364    /// Creates a builder for this type with the required parameters:
365    /// * `line_number`: Line number in resource content.
366    /// * `line_content`: Line with match content.
367    pub fn builder(line_number: f64, line_content: impl Into<Cow<'a, str>>) -> SearchMatchBuilder<'a> {
368        SearchMatchBuilder {
369            line_number: line_number,
370            line_content: line_content.into(),
371        }
372    }
373    /// Line number in resource content.
374    pub fn line_number(&self) -> f64 { self.line_number }
375    /// Line with match content.
376    pub fn line_content(&self) -> &str { self.line_content.as_ref() }
377}
378
379
380pub struct SearchMatchBuilder<'a> {
381    line_number: f64,
382    line_content: Cow<'a, str>,
383}
384
385impl<'a> SearchMatchBuilder<'a> {
386    pub fn build(self) -> SearchMatch<'a> {
387        SearchMatch {
388            line_number: self.line_number,
389            line_content: self.line_content,
390        }
391    }
392}
393
394
395#[derive(Debug, Clone, Serialize, Deserialize, Default)]
396#[serde(rename_all = "camelCase")]
397pub struct BreakLocation<'a> {
398    /// Script identifier as reported in the 'Debugger.scriptParsed'.
399    #[serde(rename = "scriptId")]
400    script_id: crate::runtime::ScriptId<'a>,
401    /// Line number in the script (0-based).
402    #[serde(rename = "lineNumber")]
403    line_number: i64,
404    /// Column number in the script (0-based).
405    #[serde(skip_serializing_if = "Option::is_none", rename = "columnNumber")]
406    column_number: Option<i64>,
407    #[serde(skip_serializing_if = "Option::is_none", rename = "type")]
408    type_: Option<Cow<'a, str>>,
409}
410
411impl<'a> BreakLocation<'a> {
412    /// Creates a builder for this type with the required parameters:
413    /// * `script_id`: Script identifier as reported in the `Debugger.scriptParsed`.
414    /// * `line_number`: Line number in the script (0-based).
415    pub fn builder(script_id: crate::runtime::ScriptId<'a>, line_number: i64) -> BreakLocationBuilder<'a> {
416        BreakLocationBuilder {
417            script_id: script_id,
418            line_number: line_number,
419            column_number: None,
420            type_: None,
421        }
422    }
423    /// Script identifier as reported in the 'Debugger.scriptParsed'.
424    pub fn script_id(&self) -> &crate::runtime::ScriptId<'a> { &self.script_id }
425    /// Line number in the script (0-based).
426    pub fn line_number(&self) -> i64 { self.line_number }
427    /// Column number in the script (0-based).
428    pub fn column_number(&self) -> Option<i64> { self.column_number }
429    pub fn type_(&self) -> Option<&str> { self.type_.as_deref() }
430}
431
432
433pub struct BreakLocationBuilder<'a> {
434    script_id: crate::runtime::ScriptId<'a>,
435    line_number: i64,
436    column_number: Option<i64>,
437    type_: Option<Cow<'a, str>>,
438}
439
440impl<'a> BreakLocationBuilder<'a> {
441    /// Column number in the script (0-based).
442    pub fn column_number(mut self, column_number: i64) -> Self { self.column_number = Some(column_number); self }
443    pub fn type_(mut self, type_: impl Into<Cow<'a, str>>) -> Self { self.type_ = Some(type_.into()); self }
444    pub fn build(self) -> BreakLocation<'a> {
445        BreakLocation {
446            script_id: self.script_id,
447            line_number: self.line_number,
448            column_number: self.column_number,
449            type_: self.type_,
450        }
451    }
452}
453
454
455#[derive(Debug, Clone, Serialize, Deserialize, Default)]
456#[serde(rename_all = "camelCase")]
457pub struct WasmDisassemblyChunk<'a> {
458    /// The next chunk of disassembled lines.
459    lines: Vec<Cow<'a, str>>,
460    /// The bytecode offsets describing the start of each line.
461    #[serde(rename = "bytecodeOffsets")]
462    bytecode_offsets: Vec<i64>,
463}
464
465impl<'a> WasmDisassemblyChunk<'a> {
466    /// Creates a builder for this type with the required parameters:
467    /// * `lines`: The next chunk of disassembled lines.
468    /// * `bytecode_offsets`: The bytecode offsets describing the start of each line.
469    pub fn builder(lines: Vec<Cow<'a, str>>, bytecode_offsets: Vec<i64>) -> WasmDisassemblyChunkBuilder<'a> {
470        WasmDisassemblyChunkBuilder {
471            lines: lines,
472            bytecode_offsets: bytecode_offsets,
473        }
474    }
475    /// The next chunk of disassembled lines.
476    pub fn lines(&self) -> &[Cow<'a, str>] { &self.lines }
477    /// The bytecode offsets describing the start of each line.
478    pub fn bytecode_offsets(&self) -> &[i64] { &self.bytecode_offsets }
479}
480
481
482pub struct WasmDisassemblyChunkBuilder<'a> {
483    lines: Vec<Cow<'a, str>>,
484    bytecode_offsets: Vec<i64>,
485}
486
487impl<'a> WasmDisassemblyChunkBuilder<'a> {
488    pub fn build(self) -> WasmDisassemblyChunk<'a> {
489        WasmDisassemblyChunk {
490            lines: self.lines,
491            bytecode_offsets: self.bytecode_offsets,
492        }
493    }
494}
495
496/// Enum of possible script languages.
497
498#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
499pub enum ScriptLanguage {
500    #[default]
501    #[serde(rename = "JavaScript")]
502    JavaScript,
503    #[serde(rename = "WebAssembly")]
504    WebAssembly,
505}
506
507/// Debug symbols available for a wasm script.
508
509#[derive(Debug, Clone, Serialize, Deserialize, Default)]
510#[serde(rename_all = "camelCase")]
511pub struct DebugSymbols<'a> {
512    /// Type of the debug symbols.
513    #[serde(rename = "type")]
514    type_: Cow<'a, str>,
515    /// URL of the external symbol source.
516    #[serde(skip_serializing_if = "Option::is_none", rename = "externalURL")]
517    external_url: Option<Cow<'a, str>>,
518}
519
520impl<'a> DebugSymbols<'a> {
521    /// Creates a builder for this type with the required parameters:
522    /// * `type_`: Type of the debug symbols.
523    pub fn builder(type_: impl Into<Cow<'a, str>>) -> DebugSymbolsBuilder<'a> {
524        DebugSymbolsBuilder {
525            type_: type_.into(),
526            external_url: None,
527        }
528    }
529    /// Type of the debug symbols.
530    pub fn type_(&self) -> &str { self.type_.as_ref() }
531    /// URL of the external symbol source.
532    pub fn external_url(&self) -> Option<&str> { self.external_url.as_deref() }
533}
534
535
536pub struct DebugSymbolsBuilder<'a> {
537    type_: Cow<'a, str>,
538    external_url: Option<Cow<'a, str>>,
539}
540
541impl<'a> DebugSymbolsBuilder<'a> {
542    /// URL of the external symbol source.
543    pub fn external_url(mut self, external_url: impl Into<Cow<'a, str>>) -> Self { self.external_url = Some(external_url.into()); self }
544    pub fn build(self) -> DebugSymbols<'a> {
545        DebugSymbols {
546            type_: self.type_,
547            external_url: self.external_url,
548        }
549    }
550}
551
552
553#[derive(Debug, Clone, Serialize, Deserialize, Default)]
554#[serde(rename_all = "camelCase")]
555pub struct ResolvedBreakpoint<'a> {
556    /// Breakpoint unique identifier.
557    #[serde(rename = "breakpointId")]
558    breakpoint_id: BreakpointId<'a>,
559    /// Actual breakpoint location.
560    location: Location<'a>,
561}
562
563impl<'a> ResolvedBreakpoint<'a> {
564    /// Creates a builder for this type with the required parameters:
565    /// * `breakpoint_id`: Breakpoint unique identifier.
566    /// * `location`: Actual breakpoint location.
567    pub fn builder(breakpoint_id: impl Into<BreakpointId<'a>>, location: Location<'a>) -> ResolvedBreakpointBuilder<'a> {
568        ResolvedBreakpointBuilder {
569            breakpoint_id: breakpoint_id.into(),
570            location: location,
571        }
572    }
573    /// Breakpoint unique identifier.
574    pub fn breakpoint_id(&self) -> &BreakpointId<'a> { &self.breakpoint_id }
575    /// Actual breakpoint location.
576    pub fn location(&self) -> &Location<'a> { &self.location }
577}
578
579
580pub struct ResolvedBreakpointBuilder<'a> {
581    breakpoint_id: BreakpointId<'a>,
582    location: Location<'a>,
583}
584
585impl<'a> ResolvedBreakpointBuilder<'a> {
586    pub fn build(self) -> ResolvedBreakpoint<'a> {
587        ResolvedBreakpoint {
588            breakpoint_id: self.breakpoint_id,
589            location: self.location,
590        }
591    }
592}
593
594/// Continues execution until specific location is reached.
595
596#[derive(Debug, Clone, Serialize, Deserialize, Default)]
597#[serde(rename_all = "camelCase")]
598pub struct ContinueToLocationParams<'a> {
599    /// Location to continue to.
600    location: Location<'a>,
601    #[serde(skip_serializing_if = "Option::is_none", rename = "targetCallFrames")]
602    target_call_frames: Option<Cow<'a, str>>,
603}
604
605impl<'a> ContinueToLocationParams<'a> {
606    /// Creates a builder for this type with the required parameters:
607    /// * `location`: Location to continue to.
608    pub fn builder(location: Location<'a>) -> ContinueToLocationParamsBuilder<'a> {
609        ContinueToLocationParamsBuilder {
610            location: location,
611            target_call_frames: None,
612        }
613    }
614    /// Location to continue to.
615    pub fn location(&self) -> &Location<'a> { &self.location }
616    pub fn target_call_frames(&self) -> Option<&str> { self.target_call_frames.as_deref() }
617}
618
619
620pub struct ContinueToLocationParamsBuilder<'a> {
621    location: Location<'a>,
622    target_call_frames: Option<Cow<'a, str>>,
623}
624
625impl<'a> ContinueToLocationParamsBuilder<'a> {
626    pub fn target_call_frames(mut self, target_call_frames: impl Into<Cow<'a, str>>) -> Self { self.target_call_frames = Some(target_call_frames.into()); self }
627    pub fn build(self) -> ContinueToLocationParams<'a> {
628        ContinueToLocationParams {
629            location: self.location,
630            target_call_frames: self.target_call_frames,
631        }
632    }
633}
634
635impl<'a> ContinueToLocationParams<'a> { pub const METHOD: &'static str = "Debugger.continueToLocation"; }
636
637impl<'a> crate::CdpCommand<'a> for ContinueToLocationParams<'a> {
638    const METHOD: &'static str = "Debugger.continueToLocation";
639    type Response = crate::EmptyReturns;
640}
641
642#[derive(Debug, Clone, Serialize, Deserialize, Default)]
643pub struct DisableParams {}
644
645impl DisableParams { pub const METHOD: &'static str = "Debugger.disable"; }
646
647impl<'a> crate::CdpCommand<'a> for DisableParams {
648    const METHOD: &'static str = "Debugger.disable";
649    type Response = crate::EmptyReturns;
650}
651
652/// Enables debugger for the given page. Clients should not assume that the debugging has been
653/// enabled until the result for this command is received.
654
655#[derive(Debug, Clone, Serialize, Deserialize, Default)]
656#[serde(rename_all = "camelCase")]
657pub struct EnableParams {
658    /// The maximum size in bytes of collected scripts (not referenced by other heap objects)
659    /// the debugger can hold. Puts no limit if parameter is omitted.
660    #[serde(skip_serializing_if = "Option::is_none", rename = "maxScriptsCacheSize")]
661    max_scripts_cache_size: Option<f64>,
662}
663
664impl EnableParams {
665    /// Creates a builder for this type.
666    pub fn builder() -> EnableParamsBuilder {
667        EnableParamsBuilder {
668            max_scripts_cache_size: None,
669        }
670    }
671    /// The maximum size in bytes of collected scripts (not referenced by other heap objects)
672    /// the debugger can hold. Puts no limit if parameter is omitted.
673    pub fn max_scripts_cache_size(&self) -> Option<f64> { self.max_scripts_cache_size }
674}
675
676#[derive(Default)]
677pub struct EnableParamsBuilder {
678    max_scripts_cache_size: Option<f64>,
679}
680
681impl EnableParamsBuilder {
682    /// The maximum size in bytes of collected scripts (not referenced by other heap objects)
683    /// the debugger can hold. Puts no limit if parameter is omitted.
684    pub fn max_scripts_cache_size(mut self, max_scripts_cache_size: f64) -> Self { self.max_scripts_cache_size = Some(max_scripts_cache_size); self }
685    pub fn build(self) -> EnableParams {
686        EnableParams {
687            max_scripts_cache_size: self.max_scripts_cache_size,
688        }
689    }
690}
691
692/// Enables debugger for the given page. Clients should not assume that the debugging has been
693/// enabled until the result for this command is received.
694
695#[derive(Debug, Clone, Serialize, Deserialize, Default)]
696#[serde(rename_all = "camelCase")]
697pub struct EnableReturns<'a> {
698    /// Unique identifier of the debugger.
699    #[serde(rename = "debuggerId")]
700    debugger_id: crate::runtime::UniqueDebuggerId<'a>,
701}
702
703impl<'a> EnableReturns<'a> {
704    /// Creates a builder for this type with the required parameters:
705    /// * `debugger_id`: Unique identifier of the debugger.
706    pub fn builder(debugger_id: crate::runtime::UniqueDebuggerId<'a>) -> EnableReturnsBuilder<'a> {
707        EnableReturnsBuilder {
708            debugger_id: debugger_id,
709        }
710    }
711    /// Unique identifier of the debugger.
712    pub fn debugger_id(&self) -> &crate::runtime::UniqueDebuggerId<'a> { &self.debugger_id }
713}
714
715
716pub struct EnableReturnsBuilder<'a> {
717    debugger_id: crate::runtime::UniqueDebuggerId<'a>,
718}
719
720impl<'a> EnableReturnsBuilder<'a> {
721    pub fn build(self) -> EnableReturns<'a> {
722        EnableReturns {
723            debugger_id: self.debugger_id,
724        }
725    }
726}
727
728impl EnableParams { pub const METHOD: &'static str = "Debugger.enable"; }
729
730impl<'a> crate::CdpCommand<'a> for EnableParams {
731    const METHOD: &'static str = "Debugger.enable";
732    type Response = EnableReturns<'a>;
733}
734
735/// Evaluates expression on a given call frame.
736
737#[derive(Debug, Clone, Serialize, Deserialize, Default)]
738#[serde(rename_all = "camelCase")]
739pub struct EvaluateOnCallFrameParams<'a> {
740    /// Call frame identifier to evaluate on.
741    #[serde(rename = "callFrameId")]
742    call_frame_id: CallFrameId<'a>,
743    /// Expression to evaluate.
744    expression: Cow<'a, str>,
745    /// String object group name to put result into (allows rapid releasing resulting object handles
746    /// using 'releaseObjectGroup').
747    #[serde(skip_serializing_if = "Option::is_none", rename = "objectGroup")]
748    object_group: Option<Cow<'a, str>>,
749    /// Specifies whether command line API should be available to the evaluated expression, defaults
750    /// to false.
751    #[serde(skip_serializing_if = "Option::is_none", rename = "includeCommandLineAPI")]
752    include_command_line_api: Option<bool>,
753    /// In silent mode exceptions thrown during evaluation are not reported and do not pause
754    /// execution. Overrides 'setPauseOnException' state.
755    #[serde(skip_serializing_if = "Option::is_none")]
756    silent: Option<bool>,
757    /// Whether the result is expected to be a JSON object that should be sent by value.
758    #[serde(skip_serializing_if = "Option::is_none", rename = "returnByValue")]
759    return_by_value: Option<bool>,
760    /// Whether preview should be generated for the result.
761    #[serde(skip_serializing_if = "Option::is_none", rename = "generatePreview")]
762    generate_preview: Option<bool>,
763    /// Whether to throw an exception if side effect cannot be ruled out during evaluation.
764    #[serde(skip_serializing_if = "Option::is_none", rename = "throwOnSideEffect")]
765    throw_on_side_effect: Option<bool>,
766    /// Terminate execution after timing out (number of milliseconds).
767    #[serde(skip_serializing_if = "Option::is_none")]
768    timeout: Option<crate::runtime::TimeDelta>,
769}
770
771impl<'a> EvaluateOnCallFrameParams<'a> {
772    /// Creates a builder for this type with the required parameters:
773    /// * `call_frame_id`: Call frame identifier to evaluate on.
774    /// * `expression`: Expression to evaluate.
775    pub fn builder(call_frame_id: impl Into<CallFrameId<'a>>, expression: impl Into<Cow<'a, str>>) -> EvaluateOnCallFrameParamsBuilder<'a> {
776        EvaluateOnCallFrameParamsBuilder {
777            call_frame_id: call_frame_id.into(),
778            expression: expression.into(),
779            object_group: None,
780            include_command_line_api: None,
781            silent: None,
782            return_by_value: None,
783            generate_preview: None,
784            throw_on_side_effect: None,
785            timeout: None,
786        }
787    }
788    /// Call frame identifier to evaluate on.
789    pub fn call_frame_id(&self) -> &CallFrameId<'a> { &self.call_frame_id }
790    /// Expression to evaluate.
791    pub fn expression(&self) -> &str { self.expression.as_ref() }
792    /// String object group name to put result into (allows rapid releasing resulting object handles
793    /// using 'releaseObjectGroup').
794    pub fn object_group(&self) -> Option<&str> { self.object_group.as_deref() }
795    /// Specifies whether command line API should be available to the evaluated expression, defaults
796    /// to false.
797    pub fn include_command_line_api(&self) -> Option<bool> { self.include_command_line_api }
798    /// In silent mode exceptions thrown during evaluation are not reported and do not pause
799    /// execution. Overrides 'setPauseOnException' state.
800    pub fn silent(&self) -> Option<bool> { self.silent }
801    /// Whether the result is expected to be a JSON object that should be sent by value.
802    pub fn return_by_value(&self) -> Option<bool> { self.return_by_value }
803    /// Whether preview should be generated for the result.
804    pub fn generate_preview(&self) -> Option<bool> { self.generate_preview }
805    /// Whether to throw an exception if side effect cannot be ruled out during evaluation.
806    pub fn throw_on_side_effect(&self) -> Option<bool> { self.throw_on_side_effect }
807    /// Terminate execution after timing out (number of milliseconds).
808    pub fn timeout(&self) -> Option<&crate::runtime::TimeDelta> { self.timeout.as_ref() }
809}
810
811
812pub struct EvaluateOnCallFrameParamsBuilder<'a> {
813    call_frame_id: CallFrameId<'a>,
814    expression: Cow<'a, str>,
815    object_group: Option<Cow<'a, str>>,
816    include_command_line_api: Option<bool>,
817    silent: Option<bool>,
818    return_by_value: Option<bool>,
819    generate_preview: Option<bool>,
820    throw_on_side_effect: Option<bool>,
821    timeout: Option<crate::runtime::TimeDelta>,
822}
823
824impl<'a> EvaluateOnCallFrameParamsBuilder<'a> {
825    /// String object group name to put result into (allows rapid releasing resulting object handles
826    /// using 'releaseObjectGroup').
827    pub fn object_group(mut self, object_group: impl Into<Cow<'a, str>>) -> Self { self.object_group = Some(object_group.into()); self }
828    /// Specifies whether command line API should be available to the evaluated expression, defaults
829    /// to false.
830    pub fn include_command_line_api(mut self, include_command_line_api: bool) -> Self { self.include_command_line_api = Some(include_command_line_api); self }
831    /// In silent mode exceptions thrown during evaluation are not reported and do not pause
832    /// execution. Overrides 'setPauseOnException' state.
833    pub fn silent(mut self, silent: bool) -> Self { self.silent = Some(silent); self }
834    /// Whether the result is expected to be a JSON object that should be sent by value.
835    pub fn return_by_value(mut self, return_by_value: bool) -> Self { self.return_by_value = Some(return_by_value); self }
836    /// Whether preview should be generated for the result.
837    pub fn generate_preview(mut self, generate_preview: bool) -> Self { self.generate_preview = Some(generate_preview); self }
838    /// Whether to throw an exception if side effect cannot be ruled out during evaluation.
839    pub fn throw_on_side_effect(mut self, throw_on_side_effect: bool) -> Self { self.throw_on_side_effect = Some(throw_on_side_effect); self }
840    /// Terminate execution after timing out (number of milliseconds).
841    pub fn timeout(mut self, timeout: crate::runtime::TimeDelta) -> Self { self.timeout = Some(timeout); self }
842    pub fn build(self) -> EvaluateOnCallFrameParams<'a> {
843        EvaluateOnCallFrameParams {
844            call_frame_id: self.call_frame_id,
845            expression: self.expression,
846            object_group: self.object_group,
847            include_command_line_api: self.include_command_line_api,
848            silent: self.silent,
849            return_by_value: self.return_by_value,
850            generate_preview: self.generate_preview,
851            throw_on_side_effect: self.throw_on_side_effect,
852            timeout: self.timeout,
853        }
854    }
855}
856
857/// Evaluates expression on a given call frame.
858
859#[derive(Debug, Clone, Serialize, Deserialize, Default)]
860#[serde(rename_all = "camelCase")]
861pub struct EvaluateOnCallFrameReturns<'a> {
862    /// Object wrapper for the evaluation result.
863    result: crate::runtime::RemoteObject<'a>,
864    /// Exception details.
865    #[serde(skip_serializing_if = "Option::is_none", rename = "exceptionDetails")]
866    exception_details: Option<crate::runtime::ExceptionDetails<'a>>,
867}
868
869impl<'a> EvaluateOnCallFrameReturns<'a> {
870    /// Creates a builder for this type with the required parameters:
871    /// * `result`: Object wrapper for the evaluation result.
872    pub fn builder(result: crate::runtime::RemoteObject<'a>) -> EvaluateOnCallFrameReturnsBuilder<'a> {
873        EvaluateOnCallFrameReturnsBuilder {
874            result: result,
875            exception_details: None,
876        }
877    }
878    /// Object wrapper for the evaluation result.
879    pub fn result(&self) -> &crate::runtime::RemoteObject<'a> { &self.result }
880    /// Exception details.
881    pub fn exception_details(&self) -> Option<&crate::runtime::ExceptionDetails<'a>> { self.exception_details.as_ref() }
882}
883
884
885pub struct EvaluateOnCallFrameReturnsBuilder<'a> {
886    result: crate::runtime::RemoteObject<'a>,
887    exception_details: Option<crate::runtime::ExceptionDetails<'a>>,
888}
889
890impl<'a> EvaluateOnCallFrameReturnsBuilder<'a> {
891    /// Exception details.
892    pub fn exception_details(mut self, exception_details: crate::runtime::ExceptionDetails<'a>) -> Self { self.exception_details = Some(exception_details); self }
893    pub fn build(self) -> EvaluateOnCallFrameReturns<'a> {
894        EvaluateOnCallFrameReturns {
895            result: self.result,
896            exception_details: self.exception_details,
897        }
898    }
899}
900
901impl<'a> EvaluateOnCallFrameParams<'a> { pub const METHOD: &'static str = "Debugger.evaluateOnCallFrame"; }
902
903impl<'a> crate::CdpCommand<'a> for EvaluateOnCallFrameParams<'a> {
904    const METHOD: &'static str = "Debugger.evaluateOnCallFrame";
905    type Response = EvaluateOnCallFrameReturns<'a>;
906}
907
908/// Returns possible locations for breakpoint. scriptId in start and end range locations should be
909/// the same.
910
911#[derive(Debug, Clone, Serialize, Deserialize, Default)]
912#[serde(rename_all = "camelCase")]
913pub struct GetPossibleBreakpointsParams<'a> {
914    /// Start of range to search possible breakpoint locations in.
915    start: Location<'a>,
916    /// End of range to search possible breakpoint locations in (excluding). When not specified, end
917    /// of scripts is used as end of range.
918    #[serde(skip_serializing_if = "Option::is_none")]
919    end: Option<Location<'a>>,
920    /// Only consider locations which are in the same (non-nested) function as start.
921    #[serde(skip_serializing_if = "Option::is_none", rename = "restrictToFunction")]
922    restrict_to_function: Option<bool>,
923}
924
925impl<'a> GetPossibleBreakpointsParams<'a> {
926    /// Creates a builder for this type with the required parameters:
927    /// * `start`: Start of range to search possible breakpoint locations in.
928    pub fn builder(start: Location<'a>) -> GetPossibleBreakpointsParamsBuilder<'a> {
929        GetPossibleBreakpointsParamsBuilder {
930            start: start,
931            end: None,
932            restrict_to_function: None,
933        }
934    }
935    /// Start of range to search possible breakpoint locations in.
936    pub fn start(&self) -> &Location<'a> { &self.start }
937    /// End of range to search possible breakpoint locations in (excluding). When not specified, end
938    /// of scripts is used as end of range.
939    pub fn end(&self) -> Option<&Location<'a>> { self.end.as_ref() }
940    /// Only consider locations which are in the same (non-nested) function as start.
941    pub fn restrict_to_function(&self) -> Option<bool> { self.restrict_to_function }
942}
943
944
945pub struct GetPossibleBreakpointsParamsBuilder<'a> {
946    start: Location<'a>,
947    end: Option<Location<'a>>,
948    restrict_to_function: Option<bool>,
949}
950
951impl<'a> GetPossibleBreakpointsParamsBuilder<'a> {
952    /// End of range to search possible breakpoint locations in (excluding). When not specified, end
953    /// of scripts is used as end of range.
954    pub fn end(mut self, end: Location<'a>) -> Self { self.end = Some(end); self }
955    /// Only consider locations which are in the same (non-nested) function as start.
956    pub fn restrict_to_function(mut self, restrict_to_function: bool) -> Self { self.restrict_to_function = Some(restrict_to_function); self }
957    pub fn build(self) -> GetPossibleBreakpointsParams<'a> {
958        GetPossibleBreakpointsParams {
959            start: self.start,
960            end: self.end,
961            restrict_to_function: self.restrict_to_function,
962        }
963    }
964}
965
966/// Returns possible locations for breakpoint. scriptId in start and end range locations should be
967/// the same.
968
969#[derive(Debug, Clone, Serialize, Deserialize, Default)]
970#[serde(rename_all = "camelCase")]
971pub struct GetPossibleBreakpointsReturns<'a> {
972    /// List of the possible breakpoint locations.
973    locations: Vec<BreakLocation<'a>>,
974}
975
976impl<'a> GetPossibleBreakpointsReturns<'a> {
977    /// Creates a builder for this type with the required parameters:
978    /// * `locations`: List of the possible breakpoint locations.
979    pub fn builder(locations: Vec<BreakLocation<'a>>) -> GetPossibleBreakpointsReturnsBuilder<'a> {
980        GetPossibleBreakpointsReturnsBuilder {
981            locations: locations,
982        }
983    }
984    /// List of the possible breakpoint locations.
985    pub fn locations(&self) -> &[BreakLocation<'a>] { &self.locations }
986}
987
988
989pub struct GetPossibleBreakpointsReturnsBuilder<'a> {
990    locations: Vec<BreakLocation<'a>>,
991}
992
993impl<'a> GetPossibleBreakpointsReturnsBuilder<'a> {
994    pub fn build(self) -> GetPossibleBreakpointsReturns<'a> {
995        GetPossibleBreakpointsReturns {
996            locations: self.locations,
997        }
998    }
999}
1000
1001impl<'a> GetPossibleBreakpointsParams<'a> { pub const METHOD: &'static str = "Debugger.getPossibleBreakpoints"; }
1002
1003impl<'a> crate::CdpCommand<'a> for GetPossibleBreakpointsParams<'a> {
1004    const METHOD: &'static str = "Debugger.getPossibleBreakpoints";
1005    type Response = GetPossibleBreakpointsReturns<'a>;
1006}
1007
1008/// Returns source for the script with given id.
1009
1010#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1011#[serde(rename_all = "camelCase")]
1012pub struct GetScriptSourceParams<'a> {
1013    /// Id of the script to get source for.
1014    #[serde(rename = "scriptId")]
1015    script_id: crate::runtime::ScriptId<'a>,
1016}
1017
1018impl<'a> GetScriptSourceParams<'a> {
1019    /// Creates a builder for this type with the required parameters:
1020    /// * `script_id`: Id of the script to get source for.
1021    pub fn builder(script_id: crate::runtime::ScriptId<'a>) -> GetScriptSourceParamsBuilder<'a> {
1022        GetScriptSourceParamsBuilder {
1023            script_id: script_id,
1024        }
1025    }
1026    /// Id of the script to get source for.
1027    pub fn script_id(&self) -> &crate::runtime::ScriptId<'a> { &self.script_id }
1028}
1029
1030
1031pub struct GetScriptSourceParamsBuilder<'a> {
1032    script_id: crate::runtime::ScriptId<'a>,
1033}
1034
1035impl<'a> GetScriptSourceParamsBuilder<'a> {
1036    pub fn build(self) -> GetScriptSourceParams<'a> {
1037        GetScriptSourceParams {
1038            script_id: self.script_id,
1039        }
1040    }
1041}
1042
1043/// Returns source for the script with given id.
1044
1045#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1046#[serde(rename_all = "camelCase")]
1047pub struct GetScriptSourceReturns<'a> {
1048    /// Script source (empty in case of Wasm bytecode).
1049    #[serde(rename = "scriptSource")]
1050    script_source: Cow<'a, str>,
1051    /// Wasm bytecode. (Encoded as a base64 string when passed over JSON)
1052    #[serde(skip_serializing_if = "Option::is_none")]
1053    bytecode: Option<Cow<'a, str>>,
1054}
1055
1056impl<'a> GetScriptSourceReturns<'a> {
1057    /// Creates a builder for this type with the required parameters:
1058    /// * `script_source`: Script source (empty in case of Wasm bytecode).
1059    pub fn builder(script_source: impl Into<Cow<'a, str>>) -> GetScriptSourceReturnsBuilder<'a> {
1060        GetScriptSourceReturnsBuilder {
1061            script_source: script_source.into(),
1062            bytecode: None,
1063        }
1064    }
1065    /// Script source (empty in case of Wasm bytecode).
1066    pub fn script_source(&self) -> &str { self.script_source.as_ref() }
1067    /// Wasm bytecode. (Encoded as a base64 string when passed over JSON)
1068    pub fn bytecode(&self) -> Option<&str> { self.bytecode.as_deref() }
1069}
1070
1071
1072pub struct GetScriptSourceReturnsBuilder<'a> {
1073    script_source: Cow<'a, str>,
1074    bytecode: Option<Cow<'a, str>>,
1075}
1076
1077impl<'a> GetScriptSourceReturnsBuilder<'a> {
1078    /// Wasm bytecode. (Encoded as a base64 string when passed over JSON)
1079    pub fn bytecode(mut self, bytecode: impl Into<Cow<'a, str>>) -> Self { self.bytecode = Some(bytecode.into()); self }
1080    pub fn build(self) -> GetScriptSourceReturns<'a> {
1081        GetScriptSourceReturns {
1082            script_source: self.script_source,
1083            bytecode: self.bytecode,
1084        }
1085    }
1086}
1087
1088impl<'a> GetScriptSourceParams<'a> { pub const METHOD: &'static str = "Debugger.getScriptSource"; }
1089
1090impl<'a> crate::CdpCommand<'a> for GetScriptSourceParams<'a> {
1091    const METHOD: &'static str = "Debugger.getScriptSource";
1092    type Response = GetScriptSourceReturns<'a>;
1093}
1094
1095
1096#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1097#[serde(rename_all = "camelCase")]
1098pub struct DisassembleWasmModuleParams<'a> {
1099    /// Id of the script to disassemble
1100    #[serde(rename = "scriptId")]
1101    script_id: crate::runtime::ScriptId<'a>,
1102}
1103
1104impl<'a> DisassembleWasmModuleParams<'a> {
1105    /// Creates a builder for this type with the required parameters:
1106    /// * `script_id`: Id of the script to disassemble
1107    pub fn builder(script_id: crate::runtime::ScriptId<'a>) -> DisassembleWasmModuleParamsBuilder<'a> {
1108        DisassembleWasmModuleParamsBuilder {
1109            script_id: script_id,
1110        }
1111    }
1112    /// Id of the script to disassemble
1113    pub fn script_id(&self) -> &crate::runtime::ScriptId<'a> { &self.script_id }
1114}
1115
1116
1117pub struct DisassembleWasmModuleParamsBuilder<'a> {
1118    script_id: crate::runtime::ScriptId<'a>,
1119}
1120
1121impl<'a> DisassembleWasmModuleParamsBuilder<'a> {
1122    pub fn build(self) -> DisassembleWasmModuleParams<'a> {
1123        DisassembleWasmModuleParams {
1124            script_id: self.script_id,
1125        }
1126    }
1127}
1128
1129
1130#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1131#[serde(rename_all = "camelCase")]
1132pub struct DisassembleWasmModuleReturns<'a> {
1133    /// For large modules, return a stream from which additional chunks of
1134    /// disassembly can be read successively.
1135    #[serde(skip_serializing_if = "Option::is_none", rename = "streamId")]
1136    stream_id: Option<Cow<'a, str>>,
1137    /// The total number of lines in the disassembly text.
1138    #[serde(rename = "totalNumberOfLines")]
1139    total_number_of_lines: i64,
1140    /// The offsets of all function bodies, in the format \[start1, end1,
1141    /// start2, end2, ...\] where all ends are exclusive.
1142    #[serde(rename = "functionBodyOffsets")]
1143    function_body_offsets: Vec<i64>,
1144    /// The first chunk of disassembly.
1145    chunk: WasmDisassemblyChunk<'a>,
1146}
1147
1148impl<'a> DisassembleWasmModuleReturns<'a> {
1149    /// Creates a builder for this type with the required parameters:
1150    /// * `total_number_of_lines`: The total number of lines in the disassembly text.
1151    /// * `function_body_offsets`: The offsets of all function bodies, in the format \[start1, end1, start2, end2, ...\] where all ends are exclusive.
1152    /// * `chunk`: The first chunk of disassembly.
1153    pub fn builder(total_number_of_lines: i64, function_body_offsets: Vec<i64>, chunk: WasmDisassemblyChunk<'a>) -> DisassembleWasmModuleReturnsBuilder<'a> {
1154        DisassembleWasmModuleReturnsBuilder {
1155            stream_id: None,
1156            total_number_of_lines: total_number_of_lines,
1157            function_body_offsets: function_body_offsets,
1158            chunk: chunk,
1159        }
1160    }
1161    /// For large modules, return a stream from which additional chunks of
1162    /// disassembly can be read successively.
1163    pub fn stream_id(&self) -> Option<&str> { self.stream_id.as_deref() }
1164    /// The total number of lines in the disassembly text.
1165    pub fn total_number_of_lines(&self) -> i64 { self.total_number_of_lines }
1166    /// The offsets of all function bodies, in the format \[start1, end1,
1167    /// start2, end2, ...\] where all ends are exclusive.
1168    pub fn function_body_offsets(&self) -> &[i64] { &self.function_body_offsets }
1169    /// The first chunk of disassembly.
1170    pub fn chunk(&self) -> &WasmDisassemblyChunk<'a> { &self.chunk }
1171}
1172
1173
1174pub struct DisassembleWasmModuleReturnsBuilder<'a> {
1175    stream_id: Option<Cow<'a, str>>,
1176    total_number_of_lines: i64,
1177    function_body_offsets: Vec<i64>,
1178    chunk: WasmDisassemblyChunk<'a>,
1179}
1180
1181impl<'a> DisassembleWasmModuleReturnsBuilder<'a> {
1182    /// For large modules, return a stream from which additional chunks of
1183    /// disassembly can be read successively.
1184    pub fn stream_id(mut self, stream_id: impl Into<Cow<'a, str>>) -> Self { self.stream_id = Some(stream_id.into()); self }
1185    pub fn build(self) -> DisassembleWasmModuleReturns<'a> {
1186        DisassembleWasmModuleReturns {
1187            stream_id: self.stream_id,
1188            total_number_of_lines: self.total_number_of_lines,
1189            function_body_offsets: self.function_body_offsets,
1190            chunk: self.chunk,
1191        }
1192    }
1193}
1194
1195impl<'a> DisassembleWasmModuleParams<'a> { pub const METHOD: &'static str = "Debugger.disassembleWasmModule"; }
1196
1197impl<'a> crate::CdpCommand<'a> for DisassembleWasmModuleParams<'a> {
1198    const METHOD: &'static str = "Debugger.disassembleWasmModule";
1199    type Response = DisassembleWasmModuleReturns<'a>;
1200}
1201
1202/// Disassemble the next chunk of lines for the module corresponding to the
1203/// stream. If disassembly is complete, this API will invalidate the streamId
1204/// and return an empty chunk. Any subsequent calls for the now invalid stream
1205/// will return errors.
1206
1207#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1208#[serde(rename_all = "camelCase")]
1209pub struct NextWasmDisassemblyChunkParams<'a> {
1210    #[serde(rename = "streamId")]
1211    stream_id: Cow<'a, str>,
1212}
1213
1214impl<'a> NextWasmDisassemblyChunkParams<'a> {
1215    /// Creates a builder for this type with the required parameters:
1216    /// * `stream_id`: 
1217    pub fn builder(stream_id: impl Into<Cow<'a, str>>) -> NextWasmDisassemblyChunkParamsBuilder<'a> {
1218        NextWasmDisassemblyChunkParamsBuilder {
1219            stream_id: stream_id.into(),
1220        }
1221    }
1222    pub fn stream_id(&self) -> &str { self.stream_id.as_ref() }
1223}
1224
1225
1226pub struct NextWasmDisassemblyChunkParamsBuilder<'a> {
1227    stream_id: Cow<'a, str>,
1228}
1229
1230impl<'a> NextWasmDisassemblyChunkParamsBuilder<'a> {
1231    pub fn build(self) -> NextWasmDisassemblyChunkParams<'a> {
1232        NextWasmDisassemblyChunkParams {
1233            stream_id: self.stream_id,
1234        }
1235    }
1236}
1237
1238/// Disassemble the next chunk of lines for the module corresponding to the
1239/// stream. If disassembly is complete, this API will invalidate the streamId
1240/// and return an empty chunk. Any subsequent calls for the now invalid stream
1241/// will return errors.
1242
1243#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1244#[serde(rename_all = "camelCase")]
1245pub struct NextWasmDisassemblyChunkReturns<'a> {
1246    /// The next chunk of disassembly.
1247    chunk: WasmDisassemblyChunk<'a>,
1248}
1249
1250impl<'a> NextWasmDisassemblyChunkReturns<'a> {
1251    /// Creates a builder for this type with the required parameters:
1252    /// * `chunk`: The next chunk of disassembly.
1253    pub fn builder(chunk: WasmDisassemblyChunk<'a>) -> NextWasmDisassemblyChunkReturnsBuilder<'a> {
1254        NextWasmDisassemblyChunkReturnsBuilder {
1255            chunk: chunk,
1256        }
1257    }
1258    /// The next chunk of disassembly.
1259    pub fn chunk(&self) -> &WasmDisassemblyChunk<'a> { &self.chunk }
1260}
1261
1262
1263pub struct NextWasmDisassemblyChunkReturnsBuilder<'a> {
1264    chunk: WasmDisassemblyChunk<'a>,
1265}
1266
1267impl<'a> NextWasmDisassemblyChunkReturnsBuilder<'a> {
1268    pub fn build(self) -> NextWasmDisassemblyChunkReturns<'a> {
1269        NextWasmDisassemblyChunkReturns {
1270            chunk: self.chunk,
1271        }
1272    }
1273}
1274
1275impl<'a> NextWasmDisassemblyChunkParams<'a> { pub const METHOD: &'static str = "Debugger.nextWasmDisassemblyChunk"; }
1276
1277impl<'a> crate::CdpCommand<'a> for NextWasmDisassemblyChunkParams<'a> {
1278    const METHOD: &'static str = "Debugger.nextWasmDisassemblyChunk";
1279    type Response = NextWasmDisassemblyChunkReturns<'a>;
1280}
1281
1282/// This command is deprecated. Use getScriptSource instead.
1283
1284#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1285#[serde(rename_all = "camelCase")]
1286pub struct GetWasmBytecodeParams<'a> {
1287    /// Id of the Wasm script to get source for.
1288    #[serde(rename = "scriptId")]
1289    script_id: crate::runtime::ScriptId<'a>,
1290}
1291
1292impl<'a> GetWasmBytecodeParams<'a> {
1293    /// Creates a builder for this type with the required parameters:
1294    /// * `script_id`: Id of the Wasm script to get source for.
1295    pub fn builder(script_id: crate::runtime::ScriptId<'a>) -> GetWasmBytecodeParamsBuilder<'a> {
1296        GetWasmBytecodeParamsBuilder {
1297            script_id: script_id,
1298        }
1299    }
1300    /// Id of the Wasm script to get source for.
1301    pub fn script_id(&self) -> &crate::runtime::ScriptId<'a> { &self.script_id }
1302}
1303
1304
1305pub struct GetWasmBytecodeParamsBuilder<'a> {
1306    script_id: crate::runtime::ScriptId<'a>,
1307}
1308
1309impl<'a> GetWasmBytecodeParamsBuilder<'a> {
1310    pub fn build(self) -> GetWasmBytecodeParams<'a> {
1311        GetWasmBytecodeParams {
1312            script_id: self.script_id,
1313        }
1314    }
1315}
1316
1317/// This command is deprecated. Use getScriptSource instead.
1318
1319#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1320#[serde(rename_all = "camelCase")]
1321pub struct GetWasmBytecodeReturns<'a> {
1322    /// Script source. (Encoded as a base64 string when passed over JSON)
1323    bytecode: Cow<'a, str>,
1324}
1325
1326impl<'a> GetWasmBytecodeReturns<'a> {
1327    /// Creates a builder for this type with the required parameters:
1328    /// * `bytecode`: Script source. (Encoded as a base64 string when passed over JSON)
1329    pub fn builder(bytecode: impl Into<Cow<'a, str>>) -> GetWasmBytecodeReturnsBuilder<'a> {
1330        GetWasmBytecodeReturnsBuilder {
1331            bytecode: bytecode.into(),
1332        }
1333    }
1334    /// Script source. (Encoded as a base64 string when passed over JSON)
1335    pub fn bytecode(&self) -> &str { self.bytecode.as_ref() }
1336}
1337
1338
1339pub struct GetWasmBytecodeReturnsBuilder<'a> {
1340    bytecode: Cow<'a, str>,
1341}
1342
1343impl<'a> GetWasmBytecodeReturnsBuilder<'a> {
1344    pub fn build(self) -> GetWasmBytecodeReturns<'a> {
1345        GetWasmBytecodeReturns {
1346            bytecode: self.bytecode,
1347        }
1348    }
1349}
1350
1351impl<'a> GetWasmBytecodeParams<'a> { pub const METHOD: &'static str = "Debugger.getWasmBytecode"; }
1352
1353impl<'a> crate::CdpCommand<'a> for GetWasmBytecodeParams<'a> {
1354    const METHOD: &'static str = "Debugger.getWasmBytecode";
1355    type Response = GetWasmBytecodeReturns<'a>;
1356}
1357
1358/// Returns stack trace with given 'stackTraceId'.
1359
1360#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1361#[serde(rename_all = "camelCase")]
1362pub struct GetStackTraceParams<'a> {
1363    #[serde(rename = "stackTraceId")]
1364    stack_trace_id: crate::runtime::StackTraceId<'a>,
1365}
1366
1367impl<'a> GetStackTraceParams<'a> {
1368    /// Creates a builder for this type with the required parameters:
1369    /// * `stack_trace_id`: 
1370    pub fn builder(stack_trace_id: crate::runtime::StackTraceId<'a>) -> GetStackTraceParamsBuilder<'a> {
1371        GetStackTraceParamsBuilder {
1372            stack_trace_id: stack_trace_id,
1373        }
1374    }
1375    pub fn stack_trace_id(&self) -> &crate::runtime::StackTraceId<'a> { &self.stack_trace_id }
1376}
1377
1378
1379pub struct GetStackTraceParamsBuilder<'a> {
1380    stack_trace_id: crate::runtime::StackTraceId<'a>,
1381}
1382
1383impl<'a> GetStackTraceParamsBuilder<'a> {
1384    pub fn build(self) -> GetStackTraceParams<'a> {
1385        GetStackTraceParams {
1386            stack_trace_id: self.stack_trace_id,
1387        }
1388    }
1389}
1390
1391/// Returns stack trace with given 'stackTraceId'.
1392
1393#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1394#[serde(rename_all = "camelCase")]
1395pub struct GetStackTraceReturns<'a> {
1396    #[serde(rename = "stackTrace")]
1397    stack_trace: crate::runtime::StackTrace<'a>,
1398}
1399
1400impl<'a> GetStackTraceReturns<'a> {
1401    /// Creates a builder for this type with the required parameters:
1402    /// * `stack_trace`: 
1403    pub fn builder(stack_trace: crate::runtime::StackTrace<'a>) -> GetStackTraceReturnsBuilder<'a> {
1404        GetStackTraceReturnsBuilder {
1405            stack_trace: stack_trace,
1406        }
1407    }
1408    pub fn stack_trace(&self) -> &crate::runtime::StackTrace<'a> { &self.stack_trace }
1409}
1410
1411
1412pub struct GetStackTraceReturnsBuilder<'a> {
1413    stack_trace: crate::runtime::StackTrace<'a>,
1414}
1415
1416impl<'a> GetStackTraceReturnsBuilder<'a> {
1417    pub fn build(self) -> GetStackTraceReturns<'a> {
1418        GetStackTraceReturns {
1419            stack_trace: self.stack_trace,
1420        }
1421    }
1422}
1423
1424impl<'a> GetStackTraceParams<'a> { pub const METHOD: &'static str = "Debugger.getStackTrace"; }
1425
1426impl<'a> crate::CdpCommand<'a> for GetStackTraceParams<'a> {
1427    const METHOD: &'static str = "Debugger.getStackTrace";
1428    type Response = GetStackTraceReturns<'a>;
1429}
1430
1431#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1432pub struct PauseParams {}
1433
1434impl PauseParams { pub const METHOD: &'static str = "Debugger.pause"; }
1435
1436impl<'a> crate::CdpCommand<'a> for PauseParams {
1437    const METHOD: &'static str = "Debugger.pause";
1438    type Response = crate::EmptyReturns;
1439}
1440
1441
1442#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1443#[serde(rename_all = "camelCase")]
1444pub struct PauseOnAsyncCallParams<'a> {
1445    /// Debugger will pause when async call with given stack trace is started.
1446    #[serde(rename = "parentStackTraceId")]
1447    parent_stack_trace_id: crate::runtime::StackTraceId<'a>,
1448}
1449
1450impl<'a> PauseOnAsyncCallParams<'a> {
1451    /// Creates a builder for this type with the required parameters:
1452    /// * `parent_stack_trace_id`: Debugger will pause when async call with given stack trace is started.
1453    pub fn builder(parent_stack_trace_id: crate::runtime::StackTraceId<'a>) -> PauseOnAsyncCallParamsBuilder<'a> {
1454        PauseOnAsyncCallParamsBuilder {
1455            parent_stack_trace_id: parent_stack_trace_id,
1456        }
1457    }
1458    /// Debugger will pause when async call with given stack trace is started.
1459    pub fn parent_stack_trace_id(&self) -> &crate::runtime::StackTraceId<'a> { &self.parent_stack_trace_id }
1460}
1461
1462
1463pub struct PauseOnAsyncCallParamsBuilder<'a> {
1464    parent_stack_trace_id: crate::runtime::StackTraceId<'a>,
1465}
1466
1467impl<'a> PauseOnAsyncCallParamsBuilder<'a> {
1468    pub fn build(self) -> PauseOnAsyncCallParams<'a> {
1469        PauseOnAsyncCallParams {
1470            parent_stack_trace_id: self.parent_stack_trace_id,
1471        }
1472    }
1473}
1474
1475impl<'a> PauseOnAsyncCallParams<'a> { pub const METHOD: &'static str = "Debugger.pauseOnAsyncCall"; }
1476
1477impl<'a> crate::CdpCommand<'a> for PauseOnAsyncCallParams<'a> {
1478    const METHOD: &'static str = "Debugger.pauseOnAsyncCall";
1479    type Response = crate::EmptyReturns;
1480}
1481
1482/// Removes JavaScript breakpoint.
1483
1484#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1485#[serde(rename_all = "camelCase")]
1486pub struct RemoveBreakpointParams<'a> {
1487    #[serde(rename = "breakpointId")]
1488    breakpoint_id: BreakpointId<'a>,
1489}
1490
1491impl<'a> RemoveBreakpointParams<'a> {
1492    /// Creates a builder for this type with the required parameters:
1493    /// * `breakpoint_id`: 
1494    pub fn builder(breakpoint_id: impl Into<BreakpointId<'a>>) -> RemoveBreakpointParamsBuilder<'a> {
1495        RemoveBreakpointParamsBuilder {
1496            breakpoint_id: breakpoint_id.into(),
1497        }
1498    }
1499    pub fn breakpoint_id(&self) -> &BreakpointId<'a> { &self.breakpoint_id }
1500}
1501
1502
1503pub struct RemoveBreakpointParamsBuilder<'a> {
1504    breakpoint_id: BreakpointId<'a>,
1505}
1506
1507impl<'a> RemoveBreakpointParamsBuilder<'a> {
1508    pub fn build(self) -> RemoveBreakpointParams<'a> {
1509        RemoveBreakpointParams {
1510            breakpoint_id: self.breakpoint_id,
1511        }
1512    }
1513}
1514
1515impl<'a> RemoveBreakpointParams<'a> { pub const METHOD: &'static str = "Debugger.removeBreakpoint"; }
1516
1517impl<'a> crate::CdpCommand<'a> for RemoveBreakpointParams<'a> {
1518    const METHOD: &'static str = "Debugger.removeBreakpoint";
1519    type Response = crate::EmptyReturns;
1520}
1521
1522/// Restarts particular call frame from the beginning. The old, deprecated
1523/// behavior of 'restartFrame' is to stay paused and allow further CDP commands
1524/// after a restart was scheduled. This can cause problems with restarting, so
1525/// we now continue execution immediatly after it has been scheduled until we
1526/// reach the beginning of the restarted frame.
1527/// 
1528/// To stay back-wards compatible, 'restartFrame' now expects a 'mode'
1529/// parameter to be present. If the 'mode' parameter is missing, 'restartFrame'
1530/// errors out.
1531/// 
1532/// The various return values are deprecated and 'callFrames' is always empty.
1533/// Use the call frames from the 'Debugger#paused' events instead, that fires
1534/// once V8 pauses at the beginning of the restarted function.
1535
1536#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1537#[serde(rename_all = "camelCase")]
1538pub struct RestartFrameParams<'a> {
1539    /// Call frame identifier to evaluate on.
1540    #[serde(rename = "callFrameId")]
1541    call_frame_id: CallFrameId<'a>,
1542    /// The 'mode' parameter must be present and set to 'StepInto', otherwise
1543    /// 'restartFrame' will error out.
1544    #[serde(skip_serializing_if = "Option::is_none")]
1545    mode: Option<Cow<'a, str>>,
1546}
1547
1548impl<'a> RestartFrameParams<'a> {
1549    /// Creates a builder for this type with the required parameters:
1550    /// * `call_frame_id`: Call frame identifier to evaluate on.
1551    pub fn builder(call_frame_id: impl Into<CallFrameId<'a>>) -> RestartFrameParamsBuilder<'a> {
1552        RestartFrameParamsBuilder {
1553            call_frame_id: call_frame_id.into(),
1554            mode: None,
1555        }
1556    }
1557    /// Call frame identifier to evaluate on.
1558    pub fn call_frame_id(&self) -> &CallFrameId<'a> { &self.call_frame_id }
1559    /// The 'mode' parameter must be present and set to 'StepInto', otherwise
1560    /// 'restartFrame' will error out.
1561    pub fn mode(&self) -> Option<&str> { self.mode.as_deref() }
1562}
1563
1564
1565pub struct RestartFrameParamsBuilder<'a> {
1566    call_frame_id: CallFrameId<'a>,
1567    mode: Option<Cow<'a, str>>,
1568}
1569
1570impl<'a> RestartFrameParamsBuilder<'a> {
1571    /// The 'mode' parameter must be present and set to 'StepInto', otherwise
1572    /// 'restartFrame' will error out.
1573    pub fn mode(mut self, mode: impl Into<Cow<'a, str>>) -> Self { self.mode = Some(mode.into()); self }
1574    pub fn build(self) -> RestartFrameParams<'a> {
1575        RestartFrameParams {
1576            call_frame_id: self.call_frame_id,
1577            mode: self.mode,
1578        }
1579    }
1580}
1581
1582/// Restarts particular call frame from the beginning. The old, deprecated
1583/// behavior of 'restartFrame' is to stay paused and allow further CDP commands
1584/// after a restart was scheduled. This can cause problems with restarting, so
1585/// we now continue execution immediatly after it has been scheduled until we
1586/// reach the beginning of the restarted frame.
1587/// 
1588/// To stay back-wards compatible, 'restartFrame' now expects a 'mode'
1589/// parameter to be present. If the 'mode' parameter is missing, 'restartFrame'
1590/// errors out.
1591/// 
1592/// The various return values are deprecated and 'callFrames' is always empty.
1593/// Use the call frames from the 'Debugger#paused' events instead, that fires
1594/// once V8 pauses at the beginning of the restarted function.
1595
1596#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1597#[serde(rename_all = "camelCase")]
1598pub struct RestartFrameReturns<'a> {
1599    /// New stack trace.
1600    #[serde(rename = "callFrames")]
1601    call_frames: Vec<CallFrame<'a>>,
1602    /// Async stack trace, if any.
1603    #[serde(skip_serializing_if = "Option::is_none", rename = "asyncStackTrace")]
1604    async_stack_trace: Option<crate::runtime::StackTrace<'a>>,
1605    /// Async stack trace, if any.
1606    #[serde(skip_serializing_if = "Option::is_none", rename = "asyncStackTraceId")]
1607    async_stack_trace_id: Option<crate::runtime::StackTraceId<'a>>,
1608}
1609
1610impl<'a> RestartFrameReturns<'a> {
1611    /// Creates a builder for this type with the required parameters:
1612    /// * `call_frames`: New stack trace.
1613    pub fn builder(call_frames: Vec<CallFrame<'a>>) -> RestartFrameReturnsBuilder<'a> {
1614        RestartFrameReturnsBuilder {
1615            call_frames: call_frames,
1616            async_stack_trace: None,
1617            async_stack_trace_id: None,
1618        }
1619    }
1620    /// New stack trace.
1621    pub fn call_frames(&self) -> &[CallFrame<'a>] { &self.call_frames }
1622    /// Async stack trace, if any.
1623    pub fn async_stack_trace(&self) -> Option<&crate::runtime::StackTrace<'a>> { self.async_stack_trace.as_ref() }
1624    /// Async stack trace, if any.
1625    pub fn async_stack_trace_id(&self) -> Option<&crate::runtime::StackTraceId<'a>> { self.async_stack_trace_id.as_ref() }
1626}
1627
1628
1629pub struct RestartFrameReturnsBuilder<'a> {
1630    call_frames: Vec<CallFrame<'a>>,
1631    async_stack_trace: Option<crate::runtime::StackTrace<'a>>,
1632    async_stack_trace_id: Option<crate::runtime::StackTraceId<'a>>,
1633}
1634
1635impl<'a> RestartFrameReturnsBuilder<'a> {
1636    /// Async stack trace, if any.
1637    pub fn async_stack_trace(mut self, async_stack_trace: crate::runtime::StackTrace<'a>) -> Self { self.async_stack_trace = Some(async_stack_trace); self }
1638    /// Async stack trace, if any.
1639    pub fn async_stack_trace_id(mut self, async_stack_trace_id: crate::runtime::StackTraceId<'a>) -> Self { self.async_stack_trace_id = Some(async_stack_trace_id); self }
1640    pub fn build(self) -> RestartFrameReturns<'a> {
1641        RestartFrameReturns {
1642            call_frames: self.call_frames,
1643            async_stack_trace: self.async_stack_trace,
1644            async_stack_trace_id: self.async_stack_trace_id,
1645        }
1646    }
1647}
1648
1649impl<'a> RestartFrameParams<'a> { pub const METHOD: &'static str = "Debugger.restartFrame"; }
1650
1651impl<'a> crate::CdpCommand<'a> for RestartFrameParams<'a> {
1652    const METHOD: &'static str = "Debugger.restartFrame";
1653    type Response = RestartFrameReturns<'a>;
1654}
1655
1656/// Resumes JavaScript execution.
1657
1658#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1659#[serde(rename_all = "camelCase")]
1660pub struct ResumeParams {
1661    /// Set to true to terminate execution upon resuming execution. In contrast
1662    /// to Runtime.terminateExecution, this will allows to execute further
1663    /// JavaScript (i.e. via evaluation) until execution of the paused code
1664    /// is actually resumed, at which point termination is triggered.
1665    /// If execution is currently not paused, this parameter has no effect.
1666    #[serde(skip_serializing_if = "Option::is_none", rename = "terminateOnResume")]
1667    terminate_on_resume: Option<bool>,
1668}
1669
1670impl ResumeParams {
1671    /// Creates a builder for this type.
1672    pub fn builder() -> ResumeParamsBuilder {
1673        ResumeParamsBuilder {
1674            terminate_on_resume: None,
1675        }
1676    }
1677    /// Set to true to terminate execution upon resuming execution. In contrast
1678    /// to Runtime.terminateExecution, this will allows to execute further
1679    /// JavaScript (i.e. via evaluation) until execution of the paused code
1680    /// is actually resumed, at which point termination is triggered.
1681    /// If execution is currently not paused, this parameter has no effect.
1682    pub fn terminate_on_resume(&self) -> Option<bool> { self.terminate_on_resume }
1683}
1684
1685#[derive(Default)]
1686pub struct ResumeParamsBuilder {
1687    terminate_on_resume: Option<bool>,
1688}
1689
1690impl ResumeParamsBuilder {
1691    /// Set to true to terminate execution upon resuming execution. In contrast
1692    /// to Runtime.terminateExecution, this will allows to execute further
1693    /// JavaScript (i.e. via evaluation) until execution of the paused code
1694    /// is actually resumed, at which point termination is triggered.
1695    /// If execution is currently not paused, this parameter has no effect.
1696    pub fn terminate_on_resume(mut self, terminate_on_resume: bool) -> Self { self.terminate_on_resume = Some(terminate_on_resume); self }
1697    pub fn build(self) -> ResumeParams {
1698        ResumeParams {
1699            terminate_on_resume: self.terminate_on_resume,
1700        }
1701    }
1702}
1703
1704impl ResumeParams { pub const METHOD: &'static str = "Debugger.resume"; }
1705
1706impl<'a> crate::CdpCommand<'a> for ResumeParams {
1707    const METHOD: &'static str = "Debugger.resume";
1708    type Response = crate::EmptyReturns;
1709}
1710
1711/// Searches for given string in script content.
1712
1713#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1714#[serde(rename_all = "camelCase")]
1715pub struct SearchInContentParams<'a> {
1716    /// Id of the script to search in.
1717    #[serde(rename = "scriptId")]
1718    script_id: crate::runtime::ScriptId<'a>,
1719    /// String to search for.
1720    query: Cow<'a, str>,
1721    /// If true, search is case sensitive.
1722    #[serde(skip_serializing_if = "Option::is_none", rename = "caseSensitive")]
1723    case_sensitive: Option<bool>,
1724    /// If true, treats string parameter as regex.
1725    #[serde(skip_serializing_if = "Option::is_none", rename = "isRegex")]
1726    is_regex: Option<bool>,
1727}
1728
1729impl<'a> SearchInContentParams<'a> {
1730    /// Creates a builder for this type with the required parameters:
1731    /// * `script_id`: Id of the script to search in.
1732    /// * `query`: String to search for.
1733    pub fn builder(script_id: crate::runtime::ScriptId<'a>, query: impl Into<Cow<'a, str>>) -> SearchInContentParamsBuilder<'a> {
1734        SearchInContentParamsBuilder {
1735            script_id: script_id,
1736            query: query.into(),
1737            case_sensitive: None,
1738            is_regex: None,
1739        }
1740    }
1741    /// Id of the script to search in.
1742    pub fn script_id(&self) -> &crate::runtime::ScriptId<'a> { &self.script_id }
1743    /// String to search for.
1744    pub fn query(&self) -> &str { self.query.as_ref() }
1745    /// If true, search is case sensitive.
1746    pub fn case_sensitive(&self) -> Option<bool> { self.case_sensitive }
1747    /// If true, treats string parameter as regex.
1748    pub fn is_regex(&self) -> Option<bool> { self.is_regex }
1749}
1750
1751
1752pub struct SearchInContentParamsBuilder<'a> {
1753    script_id: crate::runtime::ScriptId<'a>,
1754    query: Cow<'a, str>,
1755    case_sensitive: Option<bool>,
1756    is_regex: Option<bool>,
1757}
1758
1759impl<'a> SearchInContentParamsBuilder<'a> {
1760    /// If true, search is case sensitive.
1761    pub fn case_sensitive(mut self, case_sensitive: bool) -> Self { self.case_sensitive = Some(case_sensitive); self }
1762    /// If true, treats string parameter as regex.
1763    pub fn is_regex(mut self, is_regex: bool) -> Self { self.is_regex = Some(is_regex); self }
1764    pub fn build(self) -> SearchInContentParams<'a> {
1765        SearchInContentParams {
1766            script_id: self.script_id,
1767            query: self.query,
1768            case_sensitive: self.case_sensitive,
1769            is_regex: self.is_regex,
1770        }
1771    }
1772}
1773
1774/// Searches for given string in script content.
1775
1776#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1777#[serde(rename_all = "camelCase")]
1778pub struct SearchInContentReturns<'a> {
1779    /// List of search matches.
1780    result: Vec<SearchMatch<'a>>,
1781}
1782
1783impl<'a> SearchInContentReturns<'a> {
1784    /// Creates a builder for this type with the required parameters:
1785    /// * `result`: List of search matches.
1786    pub fn builder(result: Vec<SearchMatch<'a>>) -> SearchInContentReturnsBuilder<'a> {
1787        SearchInContentReturnsBuilder {
1788            result: result,
1789        }
1790    }
1791    /// List of search matches.
1792    pub fn result(&self) -> &[SearchMatch<'a>] { &self.result }
1793}
1794
1795
1796pub struct SearchInContentReturnsBuilder<'a> {
1797    result: Vec<SearchMatch<'a>>,
1798}
1799
1800impl<'a> SearchInContentReturnsBuilder<'a> {
1801    pub fn build(self) -> SearchInContentReturns<'a> {
1802        SearchInContentReturns {
1803            result: self.result,
1804        }
1805    }
1806}
1807
1808impl<'a> SearchInContentParams<'a> { pub const METHOD: &'static str = "Debugger.searchInContent"; }
1809
1810impl<'a> crate::CdpCommand<'a> for SearchInContentParams<'a> {
1811    const METHOD: &'static str = "Debugger.searchInContent";
1812    type Response = SearchInContentReturns<'a>;
1813}
1814
1815/// Enables or disables async call stacks tracking.
1816
1817#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1818#[serde(rename_all = "camelCase")]
1819pub struct SetAsyncCallStackDepthParams {
1820    /// Maximum depth of async call stacks. Setting to '0' will effectively disable collecting async
1821    /// call stacks (default).
1822    #[serde(rename = "maxDepth")]
1823    max_depth: i64,
1824}
1825
1826impl SetAsyncCallStackDepthParams {
1827    /// Creates a builder for this type with the required parameters:
1828    /// * `max_depth`: Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async call stacks (default).
1829    pub fn builder(max_depth: i64) -> SetAsyncCallStackDepthParamsBuilder {
1830        SetAsyncCallStackDepthParamsBuilder {
1831            max_depth: max_depth,
1832        }
1833    }
1834    /// Maximum depth of async call stacks. Setting to '0' will effectively disable collecting async
1835    /// call stacks (default).
1836    pub fn max_depth(&self) -> i64 { self.max_depth }
1837}
1838
1839
1840pub struct SetAsyncCallStackDepthParamsBuilder {
1841    max_depth: i64,
1842}
1843
1844impl SetAsyncCallStackDepthParamsBuilder {
1845    pub fn build(self) -> SetAsyncCallStackDepthParams {
1846        SetAsyncCallStackDepthParams {
1847            max_depth: self.max_depth,
1848        }
1849    }
1850}
1851
1852impl SetAsyncCallStackDepthParams { pub const METHOD: &'static str = "Debugger.setAsyncCallStackDepth"; }
1853
1854impl<'a> crate::CdpCommand<'a> for SetAsyncCallStackDepthParams {
1855    const METHOD: &'static str = "Debugger.setAsyncCallStackDepth";
1856    type Response = crate::EmptyReturns;
1857}
1858
1859/// Replace previous blackbox execution contexts with passed ones. Forces backend to skip
1860/// stepping/pausing in scripts in these execution contexts. VM will try to leave blackboxed script by
1861/// performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
1862
1863#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1864#[serde(rename_all = "camelCase")]
1865pub struct SetBlackboxExecutionContextsParams<'a> {
1866    /// Array of execution context unique ids for the debugger to ignore.
1867    #[serde(rename = "uniqueIds")]
1868    unique_ids: Vec<Cow<'a, str>>,
1869}
1870
1871impl<'a> SetBlackboxExecutionContextsParams<'a> {
1872    /// Creates a builder for this type with the required parameters:
1873    /// * `unique_ids`: Array of execution context unique ids for the debugger to ignore.
1874    pub fn builder(unique_ids: Vec<Cow<'a, str>>) -> SetBlackboxExecutionContextsParamsBuilder<'a> {
1875        SetBlackboxExecutionContextsParamsBuilder {
1876            unique_ids: unique_ids,
1877        }
1878    }
1879    /// Array of execution context unique ids for the debugger to ignore.
1880    pub fn unique_ids(&self) -> &[Cow<'a, str>] { &self.unique_ids }
1881}
1882
1883
1884pub struct SetBlackboxExecutionContextsParamsBuilder<'a> {
1885    unique_ids: Vec<Cow<'a, str>>,
1886}
1887
1888impl<'a> SetBlackboxExecutionContextsParamsBuilder<'a> {
1889    pub fn build(self) -> SetBlackboxExecutionContextsParams<'a> {
1890        SetBlackboxExecutionContextsParams {
1891            unique_ids: self.unique_ids,
1892        }
1893    }
1894}
1895
1896impl<'a> SetBlackboxExecutionContextsParams<'a> { pub const METHOD: &'static str = "Debugger.setBlackboxExecutionContexts"; }
1897
1898impl<'a> crate::CdpCommand<'a> for SetBlackboxExecutionContextsParams<'a> {
1899    const METHOD: &'static str = "Debugger.setBlackboxExecutionContexts";
1900    type Response = crate::EmptyReturns;
1901}
1902
1903/// Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in
1904/// scripts with url matching one of the patterns. VM will try to leave blackboxed script by
1905/// performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
1906
1907#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1908#[serde(rename_all = "camelCase")]
1909pub struct SetBlackboxPatternsParams<'a> {
1910    /// Array of regexps that will be used to check script url for blackbox state.
1911    patterns: Vec<Cow<'a, str>>,
1912    /// If true, also ignore scripts with no source url.
1913    #[serde(skip_serializing_if = "Option::is_none", rename = "skipAnonymous")]
1914    skip_anonymous: Option<bool>,
1915}
1916
1917impl<'a> SetBlackboxPatternsParams<'a> {
1918    /// Creates a builder for this type with the required parameters:
1919    /// * `patterns`: Array of regexps that will be used to check script url for blackbox state.
1920    pub fn builder(patterns: Vec<Cow<'a, str>>) -> SetBlackboxPatternsParamsBuilder<'a> {
1921        SetBlackboxPatternsParamsBuilder {
1922            patterns: patterns,
1923            skip_anonymous: None,
1924        }
1925    }
1926    /// Array of regexps that will be used to check script url for blackbox state.
1927    pub fn patterns(&self) -> &[Cow<'a, str>] { &self.patterns }
1928    /// If true, also ignore scripts with no source url.
1929    pub fn skip_anonymous(&self) -> Option<bool> { self.skip_anonymous }
1930}
1931
1932
1933pub struct SetBlackboxPatternsParamsBuilder<'a> {
1934    patterns: Vec<Cow<'a, str>>,
1935    skip_anonymous: Option<bool>,
1936}
1937
1938impl<'a> SetBlackboxPatternsParamsBuilder<'a> {
1939    /// If true, also ignore scripts with no source url.
1940    pub fn skip_anonymous(mut self, skip_anonymous: bool) -> Self { self.skip_anonymous = Some(skip_anonymous); self }
1941    pub fn build(self) -> SetBlackboxPatternsParams<'a> {
1942        SetBlackboxPatternsParams {
1943            patterns: self.patterns,
1944            skip_anonymous: self.skip_anonymous,
1945        }
1946    }
1947}
1948
1949impl<'a> SetBlackboxPatternsParams<'a> { pub const METHOD: &'static str = "Debugger.setBlackboxPatterns"; }
1950
1951impl<'a> crate::CdpCommand<'a> for SetBlackboxPatternsParams<'a> {
1952    const METHOD: &'static str = "Debugger.setBlackboxPatterns";
1953    type Response = crate::EmptyReturns;
1954}
1955
1956/// Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted
1957/// scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
1958/// Positions array contains positions where blackbox state is changed. First interval isn't
1959/// blackboxed. Array should be sorted.
1960
1961#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1962#[serde(rename_all = "camelCase")]
1963pub struct SetBlackboxedRangesParams<'a> {
1964    /// Id of the script.
1965    #[serde(rename = "scriptId")]
1966    script_id: crate::runtime::ScriptId<'a>,
1967    positions: Vec<ScriptPosition>,
1968}
1969
1970impl<'a> SetBlackboxedRangesParams<'a> {
1971    /// Creates a builder for this type with the required parameters:
1972    /// * `script_id`: Id of the script.
1973    /// * `positions`: 
1974    pub fn builder(script_id: crate::runtime::ScriptId<'a>, positions: Vec<ScriptPosition>) -> SetBlackboxedRangesParamsBuilder<'a> {
1975        SetBlackboxedRangesParamsBuilder {
1976            script_id: script_id,
1977            positions: positions,
1978        }
1979    }
1980    /// Id of the script.
1981    pub fn script_id(&self) -> &crate::runtime::ScriptId<'a> { &self.script_id }
1982    pub fn positions(&self) -> &[ScriptPosition] { &self.positions }
1983}
1984
1985
1986pub struct SetBlackboxedRangesParamsBuilder<'a> {
1987    script_id: crate::runtime::ScriptId<'a>,
1988    positions: Vec<ScriptPosition>,
1989}
1990
1991impl<'a> SetBlackboxedRangesParamsBuilder<'a> {
1992    pub fn build(self) -> SetBlackboxedRangesParams<'a> {
1993        SetBlackboxedRangesParams {
1994            script_id: self.script_id,
1995            positions: self.positions,
1996        }
1997    }
1998}
1999
2000impl<'a> SetBlackboxedRangesParams<'a> { pub const METHOD: &'static str = "Debugger.setBlackboxedRanges"; }
2001
2002impl<'a> crate::CdpCommand<'a> for SetBlackboxedRangesParams<'a> {
2003    const METHOD: &'static str = "Debugger.setBlackboxedRanges";
2004    type Response = crate::EmptyReturns;
2005}
2006
2007/// Sets JavaScript breakpoint at a given location.
2008
2009#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2010#[serde(rename_all = "camelCase")]
2011pub struct SetBreakpointParams<'a> {
2012    /// Location to set breakpoint in.
2013    location: Location<'a>,
2014    /// Expression to use as a breakpoint condition. When specified, debugger will only stop on the
2015    /// breakpoint if this expression evaluates to true.
2016    #[serde(skip_serializing_if = "Option::is_none")]
2017    condition: Option<Cow<'a, str>>,
2018}
2019
2020impl<'a> SetBreakpointParams<'a> {
2021    /// Creates a builder for this type with the required parameters:
2022    /// * `location`: Location to set breakpoint in.
2023    pub fn builder(location: Location<'a>) -> SetBreakpointParamsBuilder<'a> {
2024        SetBreakpointParamsBuilder {
2025            location: location,
2026            condition: None,
2027        }
2028    }
2029    /// Location to set breakpoint in.
2030    pub fn location(&self) -> &Location<'a> { &self.location }
2031    /// Expression to use as a breakpoint condition. When specified, debugger will only stop on the
2032    /// breakpoint if this expression evaluates to true.
2033    pub fn condition(&self) -> Option<&str> { self.condition.as_deref() }
2034}
2035
2036
2037pub struct SetBreakpointParamsBuilder<'a> {
2038    location: Location<'a>,
2039    condition: Option<Cow<'a, str>>,
2040}
2041
2042impl<'a> SetBreakpointParamsBuilder<'a> {
2043    /// Expression to use as a breakpoint condition. When specified, debugger will only stop on the
2044    /// breakpoint if this expression evaluates to true.
2045    pub fn condition(mut self, condition: impl Into<Cow<'a, str>>) -> Self { self.condition = Some(condition.into()); self }
2046    pub fn build(self) -> SetBreakpointParams<'a> {
2047        SetBreakpointParams {
2048            location: self.location,
2049            condition: self.condition,
2050        }
2051    }
2052}
2053
2054/// Sets JavaScript breakpoint at a given location.
2055
2056#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2057#[serde(rename_all = "camelCase")]
2058pub struct SetBreakpointReturns<'a> {
2059    /// Id of the created breakpoint for further reference.
2060    #[serde(rename = "breakpointId")]
2061    breakpoint_id: BreakpointId<'a>,
2062    /// Location this breakpoint resolved into.
2063    #[serde(rename = "actualLocation")]
2064    actual_location: Location<'a>,
2065}
2066
2067impl<'a> SetBreakpointReturns<'a> {
2068    /// Creates a builder for this type with the required parameters:
2069    /// * `breakpoint_id`: Id of the created breakpoint for further reference.
2070    /// * `actual_location`: Location this breakpoint resolved into.
2071    pub fn builder(breakpoint_id: impl Into<BreakpointId<'a>>, actual_location: Location<'a>) -> SetBreakpointReturnsBuilder<'a> {
2072        SetBreakpointReturnsBuilder {
2073            breakpoint_id: breakpoint_id.into(),
2074            actual_location: actual_location,
2075        }
2076    }
2077    /// Id of the created breakpoint for further reference.
2078    pub fn breakpoint_id(&self) -> &BreakpointId<'a> { &self.breakpoint_id }
2079    /// Location this breakpoint resolved into.
2080    pub fn actual_location(&self) -> &Location<'a> { &self.actual_location }
2081}
2082
2083
2084pub struct SetBreakpointReturnsBuilder<'a> {
2085    breakpoint_id: BreakpointId<'a>,
2086    actual_location: Location<'a>,
2087}
2088
2089impl<'a> SetBreakpointReturnsBuilder<'a> {
2090    pub fn build(self) -> SetBreakpointReturns<'a> {
2091        SetBreakpointReturns {
2092            breakpoint_id: self.breakpoint_id,
2093            actual_location: self.actual_location,
2094        }
2095    }
2096}
2097
2098impl<'a> SetBreakpointParams<'a> { pub const METHOD: &'static str = "Debugger.setBreakpoint"; }
2099
2100impl<'a> crate::CdpCommand<'a> for SetBreakpointParams<'a> {
2101    const METHOD: &'static str = "Debugger.setBreakpoint";
2102    type Response = SetBreakpointReturns<'a>;
2103}
2104
2105/// Sets instrumentation breakpoint.
2106
2107#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2108#[serde(rename_all = "camelCase")]
2109pub struct SetInstrumentationBreakpointParams<'a> {
2110    /// Instrumentation name.
2111    instrumentation: Cow<'a, str>,
2112}
2113
2114impl<'a> SetInstrumentationBreakpointParams<'a> {
2115    /// Creates a builder for this type with the required parameters:
2116    /// * `instrumentation`: Instrumentation name.
2117    pub fn builder(instrumentation: impl Into<Cow<'a, str>>) -> SetInstrumentationBreakpointParamsBuilder<'a> {
2118        SetInstrumentationBreakpointParamsBuilder {
2119            instrumentation: instrumentation.into(),
2120        }
2121    }
2122    /// Instrumentation name.
2123    pub fn instrumentation(&self) -> &str { self.instrumentation.as_ref() }
2124}
2125
2126
2127pub struct SetInstrumentationBreakpointParamsBuilder<'a> {
2128    instrumentation: Cow<'a, str>,
2129}
2130
2131impl<'a> SetInstrumentationBreakpointParamsBuilder<'a> {
2132    pub fn build(self) -> SetInstrumentationBreakpointParams<'a> {
2133        SetInstrumentationBreakpointParams {
2134            instrumentation: self.instrumentation,
2135        }
2136    }
2137}
2138
2139/// Sets instrumentation breakpoint.
2140
2141#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2142#[serde(rename_all = "camelCase")]
2143pub struct SetInstrumentationBreakpointReturns<'a> {
2144    /// Id of the created breakpoint for further reference.
2145    #[serde(rename = "breakpointId")]
2146    breakpoint_id: BreakpointId<'a>,
2147}
2148
2149impl<'a> SetInstrumentationBreakpointReturns<'a> {
2150    /// Creates a builder for this type with the required parameters:
2151    /// * `breakpoint_id`: Id of the created breakpoint for further reference.
2152    pub fn builder(breakpoint_id: impl Into<BreakpointId<'a>>) -> SetInstrumentationBreakpointReturnsBuilder<'a> {
2153        SetInstrumentationBreakpointReturnsBuilder {
2154            breakpoint_id: breakpoint_id.into(),
2155        }
2156    }
2157    /// Id of the created breakpoint for further reference.
2158    pub fn breakpoint_id(&self) -> &BreakpointId<'a> { &self.breakpoint_id }
2159}
2160
2161
2162pub struct SetInstrumentationBreakpointReturnsBuilder<'a> {
2163    breakpoint_id: BreakpointId<'a>,
2164}
2165
2166impl<'a> SetInstrumentationBreakpointReturnsBuilder<'a> {
2167    pub fn build(self) -> SetInstrumentationBreakpointReturns<'a> {
2168        SetInstrumentationBreakpointReturns {
2169            breakpoint_id: self.breakpoint_id,
2170        }
2171    }
2172}
2173
2174impl<'a> SetInstrumentationBreakpointParams<'a> { pub const METHOD: &'static str = "Debugger.setInstrumentationBreakpoint"; }
2175
2176impl<'a> crate::CdpCommand<'a> for SetInstrumentationBreakpointParams<'a> {
2177    const METHOD: &'static str = "Debugger.setInstrumentationBreakpoint";
2178    type Response = SetInstrumentationBreakpointReturns<'a>;
2179}
2180
2181/// Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this
2182/// command is issued, all existing parsed scripts will have breakpoints resolved and returned in
2183/// 'locations' property. Further matching script parsing will result in subsequent
2184/// 'breakpointResolved' events issued. This logical breakpoint will survive page reloads.
2185
2186#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2187#[serde(rename_all = "camelCase")]
2188pub struct SetBreakpointByUrlParams<'a> {
2189    /// Line number to set breakpoint at.
2190    #[serde(rename = "lineNumber")]
2191    line_number: i64,
2192    /// URL of the resources to set breakpoint on.
2193    #[serde(skip_serializing_if = "Option::is_none")]
2194    url: Option<Cow<'a, str>>,
2195    /// Regex pattern for the URLs of the resources to set breakpoints on. Either 'url' or
2196    /// 'urlRegex' must be specified.
2197    #[serde(skip_serializing_if = "Option::is_none", rename = "urlRegex")]
2198    url_regex: Option<Cow<'a, str>>,
2199    /// Script hash of the resources to set breakpoint on.
2200    #[serde(skip_serializing_if = "Option::is_none", rename = "scriptHash")]
2201    script_hash: Option<Cow<'a, str>>,
2202    /// Offset in the line to set breakpoint at.
2203    #[serde(skip_serializing_if = "Option::is_none", rename = "columnNumber")]
2204    column_number: Option<i64>,
2205    /// Expression to use as a breakpoint condition. When specified, debugger will only stop on the
2206    /// breakpoint if this expression evaluates to true.
2207    #[serde(skip_serializing_if = "Option::is_none")]
2208    condition: Option<Cow<'a, str>>,
2209}
2210
2211impl<'a> SetBreakpointByUrlParams<'a> {
2212    /// Creates a builder for this type with the required parameters:
2213    /// * `line_number`: Line number to set breakpoint at.
2214    pub fn builder(line_number: i64) -> SetBreakpointByUrlParamsBuilder<'a> {
2215        SetBreakpointByUrlParamsBuilder {
2216            line_number: line_number,
2217            url: None,
2218            url_regex: None,
2219            script_hash: None,
2220            column_number: None,
2221            condition: None,
2222        }
2223    }
2224    /// Line number to set breakpoint at.
2225    pub fn line_number(&self) -> i64 { self.line_number }
2226    /// URL of the resources to set breakpoint on.
2227    pub fn url(&self) -> Option<&str> { self.url.as_deref() }
2228    /// Regex pattern for the URLs of the resources to set breakpoints on. Either 'url' or
2229    /// 'urlRegex' must be specified.
2230    pub fn url_regex(&self) -> Option<&str> { self.url_regex.as_deref() }
2231    /// Script hash of the resources to set breakpoint on.
2232    pub fn script_hash(&self) -> Option<&str> { self.script_hash.as_deref() }
2233    /// Offset in the line to set breakpoint at.
2234    pub fn column_number(&self) -> Option<i64> { self.column_number }
2235    /// Expression to use as a breakpoint condition. When specified, debugger will only stop on the
2236    /// breakpoint if this expression evaluates to true.
2237    pub fn condition(&self) -> Option<&str> { self.condition.as_deref() }
2238}
2239
2240
2241pub struct SetBreakpointByUrlParamsBuilder<'a> {
2242    line_number: i64,
2243    url: Option<Cow<'a, str>>,
2244    url_regex: Option<Cow<'a, str>>,
2245    script_hash: Option<Cow<'a, str>>,
2246    column_number: Option<i64>,
2247    condition: Option<Cow<'a, str>>,
2248}
2249
2250impl<'a> SetBreakpointByUrlParamsBuilder<'a> {
2251    /// URL of the resources to set breakpoint on.
2252    pub fn url(mut self, url: impl Into<Cow<'a, str>>) -> Self { self.url = Some(url.into()); self }
2253    /// Regex pattern for the URLs of the resources to set breakpoints on. Either 'url' or
2254    /// 'urlRegex' must be specified.
2255    pub fn url_regex(mut self, url_regex: impl Into<Cow<'a, str>>) -> Self { self.url_regex = Some(url_regex.into()); self }
2256    /// Script hash of the resources to set breakpoint on.
2257    pub fn script_hash(mut self, script_hash: impl Into<Cow<'a, str>>) -> Self { self.script_hash = Some(script_hash.into()); self }
2258    /// Offset in the line to set breakpoint at.
2259    pub fn column_number(mut self, column_number: i64) -> Self { self.column_number = Some(column_number); self }
2260    /// Expression to use as a breakpoint condition. When specified, debugger will only stop on the
2261    /// breakpoint if this expression evaluates to true.
2262    pub fn condition(mut self, condition: impl Into<Cow<'a, str>>) -> Self { self.condition = Some(condition.into()); self }
2263    pub fn build(self) -> SetBreakpointByUrlParams<'a> {
2264        SetBreakpointByUrlParams {
2265            line_number: self.line_number,
2266            url: self.url,
2267            url_regex: self.url_regex,
2268            script_hash: self.script_hash,
2269            column_number: self.column_number,
2270            condition: self.condition,
2271        }
2272    }
2273}
2274
2275/// Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this
2276/// command is issued, all existing parsed scripts will have breakpoints resolved and returned in
2277/// 'locations' property. Further matching script parsing will result in subsequent
2278/// 'breakpointResolved' events issued. This logical breakpoint will survive page reloads.
2279
2280#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2281#[serde(rename_all = "camelCase")]
2282pub struct SetBreakpointByUrlReturns<'a> {
2283    /// Id of the created breakpoint for further reference.
2284    #[serde(rename = "breakpointId")]
2285    breakpoint_id: BreakpointId<'a>,
2286    /// List of the locations this breakpoint resolved into upon addition.
2287    locations: Vec<Location<'a>>,
2288}
2289
2290impl<'a> SetBreakpointByUrlReturns<'a> {
2291    /// Creates a builder for this type with the required parameters:
2292    /// * `breakpoint_id`: Id of the created breakpoint for further reference.
2293    /// * `locations`: List of the locations this breakpoint resolved into upon addition.
2294    pub fn builder(breakpoint_id: impl Into<BreakpointId<'a>>, locations: Vec<Location<'a>>) -> SetBreakpointByUrlReturnsBuilder<'a> {
2295        SetBreakpointByUrlReturnsBuilder {
2296            breakpoint_id: breakpoint_id.into(),
2297            locations: locations,
2298        }
2299    }
2300    /// Id of the created breakpoint for further reference.
2301    pub fn breakpoint_id(&self) -> &BreakpointId<'a> { &self.breakpoint_id }
2302    /// List of the locations this breakpoint resolved into upon addition.
2303    pub fn locations(&self) -> &[Location<'a>] { &self.locations }
2304}
2305
2306
2307pub struct SetBreakpointByUrlReturnsBuilder<'a> {
2308    breakpoint_id: BreakpointId<'a>,
2309    locations: Vec<Location<'a>>,
2310}
2311
2312impl<'a> SetBreakpointByUrlReturnsBuilder<'a> {
2313    pub fn build(self) -> SetBreakpointByUrlReturns<'a> {
2314        SetBreakpointByUrlReturns {
2315            breakpoint_id: self.breakpoint_id,
2316            locations: self.locations,
2317        }
2318    }
2319}
2320
2321impl<'a> SetBreakpointByUrlParams<'a> { pub const METHOD: &'static str = "Debugger.setBreakpointByUrl"; }
2322
2323impl<'a> crate::CdpCommand<'a> for SetBreakpointByUrlParams<'a> {
2324    const METHOD: &'static str = "Debugger.setBreakpointByUrl";
2325    type Response = SetBreakpointByUrlReturns<'a>;
2326}
2327
2328/// Sets JavaScript breakpoint before each call to the given function.
2329/// If another function was created from the same source as a given one,
2330/// calling it will also trigger the breakpoint.
2331
2332#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2333#[serde(rename_all = "camelCase")]
2334pub struct SetBreakpointOnFunctionCallParams<'a> {
2335    /// Function object id.
2336    #[serde(rename = "objectId")]
2337    object_id: crate::runtime::RemoteObjectId<'a>,
2338    /// Expression to use as a breakpoint condition. When specified, debugger will
2339    /// stop on the breakpoint if this expression evaluates to true.
2340    #[serde(skip_serializing_if = "Option::is_none")]
2341    condition: Option<Cow<'a, str>>,
2342}
2343
2344impl<'a> SetBreakpointOnFunctionCallParams<'a> {
2345    /// Creates a builder for this type with the required parameters:
2346    /// * `object_id`: Function object id.
2347    pub fn builder(object_id: crate::runtime::RemoteObjectId<'a>) -> SetBreakpointOnFunctionCallParamsBuilder<'a> {
2348        SetBreakpointOnFunctionCallParamsBuilder {
2349            object_id: object_id,
2350            condition: None,
2351        }
2352    }
2353    /// Function object id.
2354    pub fn object_id(&self) -> &crate::runtime::RemoteObjectId<'a> { &self.object_id }
2355    /// Expression to use as a breakpoint condition. When specified, debugger will
2356    /// stop on the breakpoint if this expression evaluates to true.
2357    pub fn condition(&self) -> Option<&str> { self.condition.as_deref() }
2358}
2359
2360
2361pub struct SetBreakpointOnFunctionCallParamsBuilder<'a> {
2362    object_id: crate::runtime::RemoteObjectId<'a>,
2363    condition: Option<Cow<'a, str>>,
2364}
2365
2366impl<'a> SetBreakpointOnFunctionCallParamsBuilder<'a> {
2367    /// Expression to use as a breakpoint condition. When specified, debugger will
2368    /// stop on the breakpoint if this expression evaluates to true.
2369    pub fn condition(mut self, condition: impl Into<Cow<'a, str>>) -> Self { self.condition = Some(condition.into()); self }
2370    pub fn build(self) -> SetBreakpointOnFunctionCallParams<'a> {
2371        SetBreakpointOnFunctionCallParams {
2372            object_id: self.object_id,
2373            condition: self.condition,
2374        }
2375    }
2376}
2377
2378/// Sets JavaScript breakpoint before each call to the given function.
2379/// If another function was created from the same source as a given one,
2380/// calling it will also trigger the breakpoint.
2381
2382#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2383#[serde(rename_all = "camelCase")]
2384pub struct SetBreakpointOnFunctionCallReturns<'a> {
2385    /// Id of the created breakpoint for further reference.
2386    #[serde(rename = "breakpointId")]
2387    breakpoint_id: BreakpointId<'a>,
2388}
2389
2390impl<'a> SetBreakpointOnFunctionCallReturns<'a> {
2391    /// Creates a builder for this type with the required parameters:
2392    /// * `breakpoint_id`: Id of the created breakpoint for further reference.
2393    pub fn builder(breakpoint_id: impl Into<BreakpointId<'a>>) -> SetBreakpointOnFunctionCallReturnsBuilder<'a> {
2394        SetBreakpointOnFunctionCallReturnsBuilder {
2395            breakpoint_id: breakpoint_id.into(),
2396        }
2397    }
2398    /// Id of the created breakpoint for further reference.
2399    pub fn breakpoint_id(&self) -> &BreakpointId<'a> { &self.breakpoint_id }
2400}
2401
2402
2403pub struct SetBreakpointOnFunctionCallReturnsBuilder<'a> {
2404    breakpoint_id: BreakpointId<'a>,
2405}
2406
2407impl<'a> SetBreakpointOnFunctionCallReturnsBuilder<'a> {
2408    pub fn build(self) -> SetBreakpointOnFunctionCallReturns<'a> {
2409        SetBreakpointOnFunctionCallReturns {
2410            breakpoint_id: self.breakpoint_id,
2411        }
2412    }
2413}
2414
2415impl<'a> SetBreakpointOnFunctionCallParams<'a> { pub const METHOD: &'static str = "Debugger.setBreakpointOnFunctionCall"; }
2416
2417impl<'a> crate::CdpCommand<'a> for SetBreakpointOnFunctionCallParams<'a> {
2418    const METHOD: &'static str = "Debugger.setBreakpointOnFunctionCall";
2419    type Response = SetBreakpointOnFunctionCallReturns<'a>;
2420}
2421
2422/// Activates / deactivates all breakpoints on the page.
2423
2424#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2425#[serde(rename_all = "camelCase")]
2426pub struct SetBreakpointsActiveParams {
2427    /// New value for breakpoints active state.
2428    active: bool,
2429}
2430
2431impl SetBreakpointsActiveParams {
2432    /// Creates a builder for this type with the required parameters:
2433    /// * `active`: New value for breakpoints active state.
2434    pub fn builder(active: bool) -> SetBreakpointsActiveParamsBuilder {
2435        SetBreakpointsActiveParamsBuilder {
2436            active: active,
2437        }
2438    }
2439    /// New value for breakpoints active state.
2440    pub fn active(&self) -> bool { self.active }
2441}
2442
2443
2444pub struct SetBreakpointsActiveParamsBuilder {
2445    active: bool,
2446}
2447
2448impl SetBreakpointsActiveParamsBuilder {
2449    pub fn build(self) -> SetBreakpointsActiveParams {
2450        SetBreakpointsActiveParams {
2451            active: self.active,
2452        }
2453    }
2454}
2455
2456impl SetBreakpointsActiveParams { pub const METHOD: &'static str = "Debugger.setBreakpointsActive"; }
2457
2458impl<'a> crate::CdpCommand<'a> for SetBreakpointsActiveParams {
2459    const METHOD: &'static str = "Debugger.setBreakpointsActive";
2460    type Response = crate::EmptyReturns;
2461}
2462
2463/// Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions,
2464/// or caught exceptions, no exceptions. Initial pause on exceptions state is 'none'.
2465
2466#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2467#[serde(rename_all = "camelCase")]
2468pub struct SetPauseOnExceptionsParams<'a> {
2469    /// Pause on exceptions mode.
2470    state: Cow<'a, str>,
2471}
2472
2473impl<'a> SetPauseOnExceptionsParams<'a> {
2474    /// Creates a builder for this type with the required parameters:
2475    /// * `state`: Pause on exceptions mode.
2476    pub fn builder(state: impl Into<Cow<'a, str>>) -> SetPauseOnExceptionsParamsBuilder<'a> {
2477        SetPauseOnExceptionsParamsBuilder {
2478            state: state.into(),
2479        }
2480    }
2481    /// Pause on exceptions mode.
2482    pub fn state(&self) -> &str { self.state.as_ref() }
2483}
2484
2485
2486pub struct SetPauseOnExceptionsParamsBuilder<'a> {
2487    state: Cow<'a, str>,
2488}
2489
2490impl<'a> SetPauseOnExceptionsParamsBuilder<'a> {
2491    pub fn build(self) -> SetPauseOnExceptionsParams<'a> {
2492        SetPauseOnExceptionsParams {
2493            state: self.state,
2494        }
2495    }
2496}
2497
2498impl<'a> SetPauseOnExceptionsParams<'a> { pub const METHOD: &'static str = "Debugger.setPauseOnExceptions"; }
2499
2500impl<'a> crate::CdpCommand<'a> for SetPauseOnExceptionsParams<'a> {
2501    const METHOD: &'static str = "Debugger.setPauseOnExceptions";
2502    type Response = crate::EmptyReturns;
2503}
2504
2505/// Changes return value in top frame. Available only at return break position.
2506
2507#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2508#[serde(rename_all = "camelCase")]
2509pub struct SetReturnValueParams<'a> {
2510    /// New return value.
2511    #[serde(rename = "newValue")]
2512    new_value: crate::runtime::CallArgument<'a>,
2513}
2514
2515impl<'a> SetReturnValueParams<'a> {
2516    /// Creates a builder for this type with the required parameters:
2517    /// * `new_value`: New return value.
2518    pub fn builder(new_value: crate::runtime::CallArgument<'a>) -> SetReturnValueParamsBuilder<'a> {
2519        SetReturnValueParamsBuilder {
2520            new_value: new_value,
2521        }
2522    }
2523    /// New return value.
2524    pub fn new_value(&self) -> &crate::runtime::CallArgument<'a> { &self.new_value }
2525}
2526
2527
2528pub struct SetReturnValueParamsBuilder<'a> {
2529    new_value: crate::runtime::CallArgument<'a>,
2530}
2531
2532impl<'a> SetReturnValueParamsBuilder<'a> {
2533    pub fn build(self) -> SetReturnValueParams<'a> {
2534        SetReturnValueParams {
2535            new_value: self.new_value,
2536        }
2537    }
2538}
2539
2540impl<'a> SetReturnValueParams<'a> { pub const METHOD: &'static str = "Debugger.setReturnValue"; }
2541
2542impl<'a> crate::CdpCommand<'a> for SetReturnValueParams<'a> {
2543    const METHOD: &'static str = "Debugger.setReturnValue";
2544    type Response = crate::EmptyReturns;
2545}
2546
2547/// Edits JavaScript source live.
2548/// 
2549/// In general, functions that are currently on the stack can not be edited with
2550/// a single exception: If the edited function is the top-most stack frame and
2551/// that is the only activation of that function on the stack. In this case
2552/// the live edit will be successful and a 'Debugger.restartFrame' for the
2553/// top-most function is automatically triggered.
2554
2555#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2556#[serde(rename_all = "camelCase")]
2557pub struct SetScriptSourceParams<'a> {
2558    /// Id of the script to edit.
2559    #[serde(rename = "scriptId")]
2560    script_id: crate::runtime::ScriptId<'a>,
2561    /// New content of the script.
2562    #[serde(rename = "scriptSource")]
2563    script_source: Cow<'a, str>,
2564    /// If true the change will not actually be applied. Dry run may be used to get result
2565    /// description without actually modifying the code.
2566    #[serde(skip_serializing_if = "Option::is_none", rename = "dryRun")]
2567    dry_run: Option<bool>,
2568    /// If true, then 'scriptSource' is allowed to change the function on top of the stack
2569    /// as long as the top-most stack frame is the only activation of that function.
2570    #[serde(skip_serializing_if = "Option::is_none", rename = "allowTopFrameEditing")]
2571    allow_top_frame_editing: Option<bool>,
2572}
2573
2574impl<'a> SetScriptSourceParams<'a> {
2575    /// Creates a builder for this type with the required parameters:
2576    /// * `script_id`: Id of the script to edit.
2577    /// * `script_source`: New content of the script.
2578    pub fn builder(script_id: crate::runtime::ScriptId<'a>, script_source: impl Into<Cow<'a, str>>) -> SetScriptSourceParamsBuilder<'a> {
2579        SetScriptSourceParamsBuilder {
2580            script_id: script_id,
2581            script_source: script_source.into(),
2582            dry_run: None,
2583            allow_top_frame_editing: None,
2584        }
2585    }
2586    /// Id of the script to edit.
2587    pub fn script_id(&self) -> &crate::runtime::ScriptId<'a> { &self.script_id }
2588    /// New content of the script.
2589    pub fn script_source(&self) -> &str { self.script_source.as_ref() }
2590    /// If true the change will not actually be applied. Dry run may be used to get result
2591    /// description without actually modifying the code.
2592    pub fn dry_run(&self) -> Option<bool> { self.dry_run }
2593    /// If true, then 'scriptSource' is allowed to change the function on top of the stack
2594    /// as long as the top-most stack frame is the only activation of that function.
2595    pub fn allow_top_frame_editing(&self) -> Option<bool> { self.allow_top_frame_editing }
2596}
2597
2598
2599pub struct SetScriptSourceParamsBuilder<'a> {
2600    script_id: crate::runtime::ScriptId<'a>,
2601    script_source: Cow<'a, str>,
2602    dry_run: Option<bool>,
2603    allow_top_frame_editing: Option<bool>,
2604}
2605
2606impl<'a> SetScriptSourceParamsBuilder<'a> {
2607    /// If true the change will not actually be applied. Dry run may be used to get result
2608    /// description without actually modifying the code.
2609    pub fn dry_run(mut self, dry_run: bool) -> Self { self.dry_run = Some(dry_run); self }
2610    /// If true, then 'scriptSource' is allowed to change the function on top of the stack
2611    /// as long as the top-most stack frame is the only activation of that function.
2612    pub fn allow_top_frame_editing(mut self, allow_top_frame_editing: bool) -> Self { self.allow_top_frame_editing = Some(allow_top_frame_editing); self }
2613    pub fn build(self) -> SetScriptSourceParams<'a> {
2614        SetScriptSourceParams {
2615            script_id: self.script_id,
2616            script_source: self.script_source,
2617            dry_run: self.dry_run,
2618            allow_top_frame_editing: self.allow_top_frame_editing,
2619        }
2620    }
2621}
2622
2623/// Edits JavaScript source live.
2624/// 
2625/// In general, functions that are currently on the stack can not be edited with
2626/// a single exception: If the edited function is the top-most stack frame and
2627/// that is the only activation of that function on the stack. In this case
2628/// the live edit will be successful and a 'Debugger.restartFrame' for the
2629/// top-most function is automatically triggered.
2630
2631#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2632#[serde(rename_all = "camelCase")]
2633pub struct SetScriptSourceReturns<'a> {
2634    /// New stack trace in case editing has happened while VM was stopped.
2635    #[serde(skip_serializing_if = "Option::is_none", rename = "callFrames")]
2636    call_frames: Option<Vec<CallFrame<'a>>>,
2637    /// Whether current call stack  was modified after applying the changes.
2638    #[serde(skip_serializing_if = "Option::is_none", rename = "stackChanged")]
2639    stack_changed: Option<bool>,
2640    /// Async stack trace, if any.
2641    #[serde(skip_serializing_if = "Option::is_none", rename = "asyncStackTrace")]
2642    async_stack_trace: Option<crate::runtime::StackTrace<'a>>,
2643    /// Async stack trace, if any.
2644    #[serde(skip_serializing_if = "Option::is_none", rename = "asyncStackTraceId")]
2645    async_stack_trace_id: Option<crate::runtime::StackTraceId<'a>>,
2646    /// Whether the operation was successful or not. Only 'Ok' denotes a
2647    /// successful live edit while the other enum variants denote why
2648    /// the live edit failed.
2649    status: Cow<'a, str>,
2650    /// Exception details if any. Only present when 'status' is 'CompileError'.
2651    #[serde(skip_serializing_if = "Option::is_none", rename = "exceptionDetails")]
2652    exception_details: Option<crate::runtime::ExceptionDetails<'a>>,
2653}
2654
2655impl<'a> SetScriptSourceReturns<'a> {
2656    /// Creates a builder for this type with the required parameters:
2657    /// * `status`: Whether the operation was successful or not. Only `Ok` denotes a successful live edit while the other enum variants denote why the live edit failed.
2658    pub fn builder(status: impl Into<Cow<'a, str>>) -> SetScriptSourceReturnsBuilder<'a> {
2659        SetScriptSourceReturnsBuilder {
2660            call_frames: None,
2661            stack_changed: None,
2662            async_stack_trace: None,
2663            async_stack_trace_id: None,
2664            status: status.into(),
2665            exception_details: None,
2666        }
2667    }
2668    /// New stack trace in case editing has happened while VM was stopped.
2669    pub fn call_frames(&self) -> Option<&[CallFrame<'a>]> { self.call_frames.as_deref() }
2670    /// Whether current call stack  was modified after applying the changes.
2671    pub fn stack_changed(&self) -> Option<bool> { self.stack_changed }
2672    /// Async stack trace, if any.
2673    pub fn async_stack_trace(&self) -> Option<&crate::runtime::StackTrace<'a>> { self.async_stack_trace.as_ref() }
2674    /// Async stack trace, if any.
2675    pub fn async_stack_trace_id(&self) -> Option<&crate::runtime::StackTraceId<'a>> { self.async_stack_trace_id.as_ref() }
2676    /// Whether the operation was successful or not. Only 'Ok' denotes a
2677    /// successful live edit while the other enum variants denote why
2678    /// the live edit failed.
2679    pub fn status(&self) -> &str { self.status.as_ref() }
2680    /// Exception details if any. Only present when 'status' is 'CompileError'.
2681    pub fn exception_details(&self) -> Option<&crate::runtime::ExceptionDetails<'a>> { self.exception_details.as_ref() }
2682}
2683
2684
2685pub struct SetScriptSourceReturnsBuilder<'a> {
2686    call_frames: Option<Vec<CallFrame<'a>>>,
2687    stack_changed: Option<bool>,
2688    async_stack_trace: Option<crate::runtime::StackTrace<'a>>,
2689    async_stack_trace_id: Option<crate::runtime::StackTraceId<'a>>,
2690    status: Cow<'a, str>,
2691    exception_details: Option<crate::runtime::ExceptionDetails<'a>>,
2692}
2693
2694impl<'a> SetScriptSourceReturnsBuilder<'a> {
2695    /// New stack trace in case editing has happened while VM was stopped.
2696    pub fn call_frames(mut self, call_frames: Vec<CallFrame<'a>>) -> Self { self.call_frames = Some(call_frames); self }
2697    /// Whether current call stack  was modified after applying the changes.
2698    pub fn stack_changed(mut self, stack_changed: bool) -> Self { self.stack_changed = Some(stack_changed); self }
2699    /// Async stack trace, if any.
2700    pub fn async_stack_trace(mut self, async_stack_trace: crate::runtime::StackTrace<'a>) -> Self { self.async_stack_trace = Some(async_stack_trace); self }
2701    /// Async stack trace, if any.
2702    pub fn async_stack_trace_id(mut self, async_stack_trace_id: crate::runtime::StackTraceId<'a>) -> Self { self.async_stack_trace_id = Some(async_stack_trace_id); self }
2703    /// Exception details if any. Only present when 'status' is 'CompileError'.
2704    pub fn exception_details(mut self, exception_details: crate::runtime::ExceptionDetails<'a>) -> Self { self.exception_details = Some(exception_details); self }
2705    pub fn build(self) -> SetScriptSourceReturns<'a> {
2706        SetScriptSourceReturns {
2707            call_frames: self.call_frames,
2708            stack_changed: self.stack_changed,
2709            async_stack_trace: self.async_stack_trace,
2710            async_stack_trace_id: self.async_stack_trace_id,
2711            status: self.status,
2712            exception_details: self.exception_details,
2713        }
2714    }
2715}
2716
2717impl<'a> SetScriptSourceParams<'a> { pub const METHOD: &'static str = "Debugger.setScriptSource"; }
2718
2719impl<'a> crate::CdpCommand<'a> for SetScriptSourceParams<'a> {
2720    const METHOD: &'static str = "Debugger.setScriptSource";
2721    type Response = SetScriptSourceReturns<'a>;
2722}
2723
2724/// Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
2725
2726#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2727#[serde(rename_all = "camelCase")]
2728pub struct SetSkipAllPausesParams {
2729    /// New value for skip pauses state.
2730    skip: bool,
2731}
2732
2733impl SetSkipAllPausesParams {
2734    /// Creates a builder for this type with the required parameters:
2735    /// * `skip`: New value for skip pauses state.
2736    pub fn builder(skip: bool) -> SetSkipAllPausesParamsBuilder {
2737        SetSkipAllPausesParamsBuilder {
2738            skip: skip,
2739        }
2740    }
2741    /// New value for skip pauses state.
2742    pub fn skip(&self) -> bool { self.skip }
2743}
2744
2745
2746pub struct SetSkipAllPausesParamsBuilder {
2747    skip: bool,
2748}
2749
2750impl SetSkipAllPausesParamsBuilder {
2751    pub fn build(self) -> SetSkipAllPausesParams {
2752        SetSkipAllPausesParams {
2753            skip: self.skip,
2754        }
2755    }
2756}
2757
2758impl SetSkipAllPausesParams { pub const METHOD: &'static str = "Debugger.setSkipAllPauses"; }
2759
2760impl<'a> crate::CdpCommand<'a> for SetSkipAllPausesParams {
2761    const METHOD: &'static str = "Debugger.setSkipAllPauses";
2762    type Response = crate::EmptyReturns;
2763}
2764
2765/// Changes value of variable in a callframe. Object-based scopes are not supported and must be
2766/// mutated manually.
2767
2768#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2769#[serde(rename_all = "camelCase")]
2770pub struct SetVariableValueParams<'a> {
2771    /// 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch'
2772    /// scope types are allowed. Other scopes could be manipulated manually.
2773    #[serde(rename = "scopeNumber")]
2774    scope_number: i64,
2775    /// Variable name.
2776    #[serde(rename = "variableName")]
2777    variable_name: Cow<'a, str>,
2778    /// New variable value.
2779    #[serde(rename = "newValue")]
2780    new_value: crate::runtime::CallArgument<'a>,
2781    /// Id of callframe that holds variable.
2782    #[serde(rename = "callFrameId")]
2783    call_frame_id: CallFrameId<'a>,
2784}
2785
2786impl<'a> SetVariableValueParams<'a> {
2787    /// Creates a builder for this type with the required parameters:
2788    /// * `scope_number`: 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.
2789    /// * `variable_name`: Variable name.
2790    /// * `new_value`: New variable value.
2791    /// * `call_frame_id`: Id of callframe that holds variable.
2792    pub fn builder(scope_number: i64, variable_name: impl Into<Cow<'a, str>>, new_value: crate::runtime::CallArgument<'a>, call_frame_id: impl Into<CallFrameId<'a>>) -> SetVariableValueParamsBuilder<'a> {
2793        SetVariableValueParamsBuilder {
2794            scope_number: scope_number,
2795            variable_name: variable_name.into(),
2796            new_value: new_value,
2797            call_frame_id: call_frame_id.into(),
2798        }
2799    }
2800    /// 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch'
2801    /// scope types are allowed. Other scopes could be manipulated manually.
2802    pub fn scope_number(&self) -> i64 { self.scope_number }
2803    /// Variable name.
2804    pub fn variable_name(&self) -> &str { self.variable_name.as_ref() }
2805    /// New variable value.
2806    pub fn new_value(&self) -> &crate::runtime::CallArgument<'a> { &self.new_value }
2807    /// Id of callframe that holds variable.
2808    pub fn call_frame_id(&self) -> &CallFrameId<'a> { &self.call_frame_id }
2809}
2810
2811
2812pub struct SetVariableValueParamsBuilder<'a> {
2813    scope_number: i64,
2814    variable_name: Cow<'a, str>,
2815    new_value: crate::runtime::CallArgument<'a>,
2816    call_frame_id: CallFrameId<'a>,
2817}
2818
2819impl<'a> SetVariableValueParamsBuilder<'a> {
2820    pub fn build(self) -> SetVariableValueParams<'a> {
2821        SetVariableValueParams {
2822            scope_number: self.scope_number,
2823            variable_name: self.variable_name,
2824            new_value: self.new_value,
2825            call_frame_id: self.call_frame_id,
2826        }
2827    }
2828}
2829
2830impl<'a> SetVariableValueParams<'a> { pub const METHOD: &'static str = "Debugger.setVariableValue"; }
2831
2832impl<'a> crate::CdpCommand<'a> for SetVariableValueParams<'a> {
2833    const METHOD: &'static str = "Debugger.setVariableValue";
2834    type Response = crate::EmptyReturns;
2835}
2836
2837/// Steps into the function call.
2838
2839#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2840#[serde(rename_all = "camelCase")]
2841pub struct StepIntoParams<'a> {
2842    /// Debugger will pause on the execution of the first async task which was scheduled
2843    /// before next pause.
2844    #[serde(skip_serializing_if = "Option::is_none", rename = "breakOnAsyncCall")]
2845    break_on_async_call: Option<bool>,
2846    /// The skipList specifies location ranges that should be skipped on step into.
2847    #[serde(skip_serializing_if = "Option::is_none", rename = "skipList")]
2848    skip_list: Option<Vec<LocationRange<'a>>>,
2849}
2850
2851impl<'a> StepIntoParams<'a> {
2852    /// Creates a builder for this type.
2853    pub fn builder() -> StepIntoParamsBuilder<'a> {
2854        StepIntoParamsBuilder {
2855            break_on_async_call: None,
2856            skip_list: None,
2857        }
2858    }
2859    /// Debugger will pause on the execution of the first async task which was scheduled
2860    /// before next pause.
2861    pub fn break_on_async_call(&self) -> Option<bool> { self.break_on_async_call }
2862    /// The skipList specifies location ranges that should be skipped on step into.
2863    pub fn skip_list(&self) -> Option<&[LocationRange<'a>]> { self.skip_list.as_deref() }
2864}
2865
2866#[derive(Default)]
2867pub struct StepIntoParamsBuilder<'a> {
2868    break_on_async_call: Option<bool>,
2869    skip_list: Option<Vec<LocationRange<'a>>>,
2870}
2871
2872impl<'a> StepIntoParamsBuilder<'a> {
2873    /// Debugger will pause on the execution of the first async task which was scheduled
2874    /// before next pause.
2875    pub fn break_on_async_call(mut self, break_on_async_call: bool) -> Self { self.break_on_async_call = Some(break_on_async_call); self }
2876    /// The skipList specifies location ranges that should be skipped on step into.
2877    pub fn skip_list(mut self, skip_list: Vec<LocationRange<'a>>) -> Self { self.skip_list = Some(skip_list); self }
2878    pub fn build(self) -> StepIntoParams<'a> {
2879        StepIntoParams {
2880            break_on_async_call: self.break_on_async_call,
2881            skip_list: self.skip_list,
2882        }
2883    }
2884}
2885
2886impl<'a> StepIntoParams<'a> { pub const METHOD: &'static str = "Debugger.stepInto"; }
2887
2888impl<'a> crate::CdpCommand<'a> for StepIntoParams<'a> {
2889    const METHOD: &'static str = "Debugger.stepInto";
2890    type Response = crate::EmptyReturns;
2891}
2892
2893#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2894pub struct StepOutParams {}
2895
2896impl StepOutParams { pub const METHOD: &'static str = "Debugger.stepOut"; }
2897
2898impl<'a> crate::CdpCommand<'a> for StepOutParams {
2899    const METHOD: &'static str = "Debugger.stepOut";
2900    type Response = crate::EmptyReturns;
2901}
2902
2903/// Steps over the statement.
2904
2905#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2906#[serde(rename_all = "camelCase")]
2907pub struct StepOverParams<'a> {
2908    /// The skipList specifies location ranges that should be skipped on step over.
2909    #[serde(skip_serializing_if = "Option::is_none", rename = "skipList")]
2910    skip_list: Option<Vec<LocationRange<'a>>>,
2911}
2912
2913impl<'a> StepOverParams<'a> {
2914    /// Creates a builder for this type.
2915    pub fn builder() -> StepOverParamsBuilder<'a> {
2916        StepOverParamsBuilder {
2917            skip_list: None,
2918        }
2919    }
2920    /// The skipList specifies location ranges that should be skipped on step over.
2921    pub fn skip_list(&self) -> Option<&[LocationRange<'a>]> { self.skip_list.as_deref() }
2922}
2923
2924#[derive(Default)]
2925pub struct StepOverParamsBuilder<'a> {
2926    skip_list: Option<Vec<LocationRange<'a>>>,
2927}
2928
2929impl<'a> StepOverParamsBuilder<'a> {
2930    /// The skipList specifies location ranges that should be skipped on step over.
2931    pub fn skip_list(mut self, skip_list: Vec<LocationRange<'a>>) -> Self { self.skip_list = Some(skip_list); self }
2932    pub fn build(self) -> StepOverParams<'a> {
2933        StepOverParams {
2934            skip_list: self.skip_list,
2935        }
2936    }
2937}
2938
2939impl<'a> StepOverParams<'a> { pub const METHOD: &'static str = "Debugger.stepOver"; }
2940
2941impl<'a> crate::CdpCommand<'a> for StepOverParams<'a> {
2942    const METHOD: &'static str = "Debugger.stepOver";
2943    type Response = crate::EmptyReturns;
2944}