Skip to main content

browser_protocol/eventbreakpoints/
mod.rs

1//! EventBreakpoints permits setting JavaScript breakpoints on operations and events
2//! occurring in native code invoked from JavaScript. Once breakpoint is hit, it is
3//! reported through Debugger domain, similarly to regular breakpoints being hit.
4use serde::{Serialize, Deserialize};
5use serde_json::Value as JsonValue;
6
7/// Sets breakpoint on particular native event.
8
9#[derive(Debug, Clone, Serialize, Deserialize, Default)]
10#[serde(rename_all = "camelCase")]
11pub struct SetInstrumentationBreakpointParams {
12    /// Instrumentation name to stop on.
13
14    pub eventName: String,
15}
16
17impl SetInstrumentationBreakpointParams { pub const METHOD: &'static str = "EventBreakpoints.setInstrumentationBreakpoint"; }
18
19impl crate::CdpCommand for SetInstrumentationBreakpointParams {
20    const METHOD: &'static str = "EventBreakpoints.setInstrumentationBreakpoint";
21    type Response = crate::EmptyReturns;
22}
23
24/// Removes breakpoint on particular native event.
25
26#[derive(Debug, Clone, Serialize, Deserialize, Default)]
27#[serde(rename_all = "camelCase")]
28pub struct RemoveInstrumentationBreakpointParams {
29    /// Instrumentation name to stop on.
30
31    pub eventName: String,
32}
33
34impl RemoveInstrumentationBreakpointParams { pub const METHOD: &'static str = "EventBreakpoints.removeInstrumentationBreakpoint"; }
35
36impl crate::CdpCommand for RemoveInstrumentationBreakpointParams {
37    const METHOD: &'static str = "EventBreakpoints.removeInstrumentationBreakpoint";
38    type Response = crate::EmptyReturns;
39}
40
41#[derive(Debug, Clone, Serialize, Deserialize, Default)]
42pub struct DisableParams {}
43
44impl DisableParams { pub const METHOD: &'static str = "EventBreakpoints.disable"; }
45
46impl crate::CdpCommand for DisableParams {
47    const METHOD: &'static str = "EventBreakpoints.disable";
48    type Response = crate::EmptyReturns;
49}