1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
///命令 marker、完整参数与成功响应。
pub mod commands;
///事件 marker 和拥有型事件参数。
pub mod events;
///命名协议类型;不包含连接状态。
pub mod types;
///薄 Domain 视图,仅借用 Session;创建不发送数据。协议来源:DOMDebugger。
///
///协议原文:
///
///<pre>DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript
///execution will stop on these operations as if there was a regular breakpoint set.</pre>
///
///
pub struct Domain<'a> {
///借用的通信路由,生命周期不超过 Session。
pub(super) session: &'a ydp_core::Session,
}
impl<'a> Domain<'a> {
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:DOMDebugger.command.getEventListeners。
///
///协议原文:
///
///<pre>Returns event listeners of the given object.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::dom_debugger::commands::GetEventListenersParams) -> ydp_core::Result<()> {
///let response = session.dom_debugger().get_event_listeners(params).await?;
///# Ok(())
///# }
///```
pub fn get_event_listeners(
&self,
params: commands::GetEventListenersParams,
) -> ydp_core::Request<commands::GetEventListeners> {
self.session.send::<commands::GetEventListeners>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:DOMDebugger.command.removeDOMBreakpoint。
///
///协议原文:
///
///<pre>Removes DOM breakpoint that was set using `setDOMBreakpoint`.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::dom_debugger::commands::RemoveDomBreakpointParams) -> ydp_core::Result<()> {
///let response = session.dom_debugger().remove_dom_breakpoint(params).await?;
///# Ok(())
///# }
///```
pub fn remove_dom_breakpoint(
&self,
params: commands::RemoveDomBreakpointParams,
) -> ydp_core::Request<commands::RemoveDomBreakpoint> {
self.session.send::<commands::RemoveDomBreakpoint>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:DOMDebugger.command.removeEventListenerBreakpoint。
///
///协议原文:
///
///<pre>Removes breakpoint on particular DOM event.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::dom_debugger::commands::RemoveEventListenerBreakpointParams) -> ydp_core::Result<()> {
///let response = session.dom_debugger().remove_event_listener_breakpoint(params).await?;
///# Ok(())
///# }
///```
pub fn remove_event_listener_breakpoint(
&self,
params: commands::RemoveEventListenerBreakpointParams,
) -> ydp_core::Request<commands::RemoveEventListenerBreakpoint> {
self.session
.send::<commands::RemoveEventListenerBreakpoint>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:DOMDebugger.command.removeInstrumentationBreakpoint。
///
///协议原文:
///
///<pre>Removes breakpoint on particular native event.</pre>
///
///此项为 experimental,端点可能不支持。此项已 deprecated,保留用于旧端点兼容。
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::dom_debugger::commands::RemoveInstrumentationBreakpointParams) -> ydp_core::Result<()> {
///let response = session.dom_debugger().remove_instrumentation_breakpoint(params).await?;
///# Ok(())
///# }
///```
pub fn remove_instrumentation_breakpoint(
&self,
params: commands::RemoveInstrumentationBreakpointParams,
) -> ydp_core::Request<commands::RemoveInstrumentationBreakpoint> {
self.session
.send::<commands::RemoveInstrumentationBreakpoint>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:DOMDebugger.command.removeXHRBreakpoint。
///
///协议原文:
///
///<pre>Removes breakpoint from XMLHttpRequest.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::dom_debugger::commands::RemoveXhrBreakpointParams) -> ydp_core::Result<()> {
///let response = session.dom_debugger().remove_xhr_breakpoint(params).await?;
///# Ok(())
///# }
///```
pub fn remove_xhr_breakpoint(
&self,
params: commands::RemoveXhrBreakpointParams,
) -> ydp_core::Request<commands::RemoveXhrBreakpoint> {
self.session.send::<commands::RemoveXhrBreakpoint>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:DOMDebugger.command.setBreakOnCSPViolation。
///
///协议原文:
///
///<pre>Sets breakpoint on particular CSP violations.</pre>
///
///此项为 experimental,端点可能不支持。
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::dom_debugger::commands::SetBreakOnCspViolationParams) -> ydp_core::Result<()> {
///let response = session.dom_debugger().set_break_on_csp_violation(params).await?;
///# Ok(())
///# }
///```
pub fn set_break_on_csp_violation(
&self,
params: commands::SetBreakOnCspViolationParams,
) -> ydp_core::Request<commands::SetBreakOnCspViolation> {
self.session
.send::<commands::SetBreakOnCspViolation>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:DOMDebugger.command.setDOMBreakpoint。
///
///协议原文:
///
///<pre>Sets breakpoint on particular operation with DOM.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::dom_debugger::commands::SetDomBreakpointParams) -> ydp_core::Result<()> {
///let response = session.dom_debugger().set_dom_breakpoint(params).await?;
///# Ok(())
///# }
///```
pub fn set_dom_breakpoint(
&self,
params: commands::SetDomBreakpointParams,
) -> ydp_core::Request<commands::SetDomBreakpoint> {
self.session.send::<commands::SetDomBreakpoint>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:DOMDebugger.command.setEventListenerBreakpoint。
///
///协议原文:
///
///<pre>Sets breakpoint on particular DOM event.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::dom_debugger::commands::SetEventListenerBreakpointParams) -> ydp_core::Result<()> {
///let response = session.dom_debugger().set_event_listener_breakpoint(params).await?;
///# Ok(())
///# }
///```
pub fn set_event_listener_breakpoint(
&self,
params: commands::SetEventListenerBreakpointParams,
) -> ydp_core::Request<commands::SetEventListenerBreakpoint> {
self.session
.send::<commands::SetEventListenerBreakpoint>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:DOMDebugger.command.setInstrumentationBreakpoint。
///
///协议原文:
///
///<pre>Sets breakpoint on particular native event.</pre>
///
///此项为 experimental,端点可能不支持。此项已 deprecated,保留用于旧端点兼容。
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::dom_debugger::commands::SetInstrumentationBreakpointParams) -> ydp_core::Result<()> {
///let response = session.dom_debugger().set_instrumentation_breakpoint(params).await?;
///# Ok(())
///# }
///```
pub fn set_instrumentation_breakpoint(
&self,
params: commands::SetInstrumentationBreakpointParams,
) -> ydp_core::Request<commands::SetInstrumentationBreakpoint> {
self.session
.send::<commands::SetInstrumentationBreakpoint>(params)
}
///拥有参数并返回冷 Request;首次 poll 才提交,Drop 仅结束本地等待,发布后远端可能继续执行。协议来源:DOMDebugger.command.setXHRBreakpoint。
///
///协议原文:
///
///<pre>Sets breakpoint on XMLHttpRequest.</pre>
///
///
///
///```no_run
///use ydp::SessionDomains as _;
///# async fn call(session: &ydp_core::Session, params: ydp::dom_debugger::commands::SetXhrBreakpointParams) -> ydp_core::Result<()> {
///let response = session.dom_debugger().set_xhr_breakpoint(params).await?;
///# Ok(())
///# }
///```
pub fn set_xhr_breakpoint(
&self,
params: commands::SetXhrBreakpointParams,
) -> ydp_core::Request<commands::SetXhrBreakpoint> {
self.session.send::<commands::SetXhrBreakpoint>(params)
}
}