rustenium_cdp_definitions/browser_protocol/event_breakpoints/
commands.rs1use serde::{Deserialize, Serialize};
2#[doc = "Sets breakpoint on particular native event.\n[setInstrumentationBreakpoint](https://chromedevtools.github.io/devtools-protocol/tot/EventBreakpoints/#method-setInstrumentationBreakpoint)"]
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct SetInstrumentationBreakpointParams {
5 #[doc = "Instrumentation name to stop on."]
6 #[serde(rename = "eventName")]
7 pub event_name: String,
8}
9impl SetInstrumentationBreakpointParams {
10 pub fn new(event_name: impl Into<String>) -> Self {
11 Self {
12 event_name: event_name.into(),
13 }
14 }
15}
16impl<T: Into<String>> From<T> for SetInstrumentationBreakpointParams {
17 fn from(url: T) -> Self {
18 SetInstrumentationBreakpointParams::new(url)
19 }
20}
21#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
22pub enum SetInstrumentationBreakpointMethod {
23 #[serde(rename = "EventBreakpoints.setInstrumentationBreakpoint")]
24 SetInstrumentationBreakpoint,
25}
26#[doc = "Sets breakpoint on particular native event.\n[setInstrumentationBreakpoint](https://chromedevtools.github.io/devtools-protocol/tot/EventBreakpoints/#method-setInstrumentationBreakpoint)"]
27#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
28pub struct SetInstrumentationBreakpoint {
29 pub method: SetInstrumentationBreakpointMethod,
30 pub params: SetInstrumentationBreakpointParams,
31}
32impl SetInstrumentationBreakpoint {
33 pub const IDENTIFIER: &'static str = "EventBreakpoints.setInstrumentationBreakpoint";
34 pub fn identifier(&self) -> &'static str {
35 Self::IDENTIFIER
36 }
37}
38impl crate::CommandResult for SetInstrumentationBreakpoint {
39 type Result = super::results::SetInstrumentationBreakpointResult;
40}
41#[doc = "Removes breakpoint on particular native event.\n[removeInstrumentationBreakpoint](https://chromedevtools.github.io/devtools-protocol/tot/EventBreakpoints/#method-removeInstrumentationBreakpoint)"]
42#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
43pub struct RemoveInstrumentationBreakpointParams {
44 #[doc = "Instrumentation name to stop on."]
45 #[serde(rename = "eventName")]
46 pub event_name: String,
47}
48impl RemoveInstrumentationBreakpointParams {
49 pub fn new(event_name: impl Into<String>) -> Self {
50 Self {
51 event_name: event_name.into(),
52 }
53 }
54}
55impl<T: Into<String>> From<T> for RemoveInstrumentationBreakpointParams {
56 fn from(url: T) -> Self {
57 RemoveInstrumentationBreakpointParams::new(url)
58 }
59}
60#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
61pub enum RemoveInstrumentationBreakpointMethod {
62 #[serde(rename = "EventBreakpoints.removeInstrumentationBreakpoint")]
63 RemoveInstrumentationBreakpoint,
64}
65#[doc = "Removes breakpoint on particular native event.\n[removeInstrumentationBreakpoint](https://chromedevtools.github.io/devtools-protocol/tot/EventBreakpoints/#method-removeInstrumentationBreakpoint)"]
66#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
67pub struct RemoveInstrumentationBreakpoint {
68 pub method: RemoveInstrumentationBreakpointMethod,
69 pub params: RemoveInstrumentationBreakpointParams,
70}
71impl RemoveInstrumentationBreakpoint {
72 pub const IDENTIFIER: &'static str = "EventBreakpoints.removeInstrumentationBreakpoint";
73 pub fn identifier(&self) -> &'static str {
74 Self::IDENTIFIER
75 }
76}
77impl crate::CommandResult for RemoveInstrumentationBreakpoint {
78 type Result = super::results::RemoveInstrumentationBreakpointResult;
79}
80#[doc = "Removes all breakpoints\n[disable](https://chromedevtools.github.io/devtools-protocol/tot/EventBreakpoints/#method-disable)"]
81#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
82pub struct DisableParams {}
83#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
84pub enum DisableMethod {
85 #[serde(rename = "EventBreakpoints.disable")]
86 Disable,
87}
88#[doc = "Removes all breakpoints\n[disable](https://chromedevtools.github.io/devtools-protocol/tot/EventBreakpoints/#method-disable)"]
89#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
90pub struct Disable {
91 pub method: DisableMethod,
92 pub params: DisableParams,
93}
94impl Disable {
95 pub const IDENTIFIER: &'static str = "EventBreakpoints.disable";
96 pub fn identifier(&self) -> &'static str {
97 Self::IDENTIFIER
98 }
99}
100impl crate::CommandResult for Disable {
101 type Result = super::results::DisableResult;
102}
103group_enum ! (EventBreakpointsCommands { SetInstrumentationBreakpoint (SetInstrumentationBreakpoint) , RemoveInstrumentationBreakpoint (RemoveInstrumentationBreakpoint) , Disable (Disable) } + identifiable);