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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
// @generated by `just generate-methods` from protocol/*.json.
// Do not edit by hand; edit xtask/ and regenerate.
//! Provides access to log entries.
//!
//! Types, command parameters and event payloads for the `Log`
//! domain. The method-name constants for the same domain are in
//! [`crate::methods`].
use serde::{Deserialize, Serialize};
/// Log entry.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LogEntry {
/// Log entry source.
pub source: LogEntrySource,
/// Log entry severity.
pub level: LogEntryLevel,
/// Logged text.
pub text: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub category: Option<LogEntryCategory>,
/// Timestamp when this entry was added.
pub timestamp: crate::protocol::runtime::Timestamp,
/// URL of the resource if known.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
/// Line number in the resource.
#[serde(
rename = "lineNumber",
default,
skip_serializing_if = "Option::is_none"
)]
pub line_number: Option<i64>,
/// JavaScript stack trace.
#[serde(
rename = "stackTrace",
default,
skip_serializing_if = "Option::is_none"
)]
pub stack_trace: Option<crate::protocol::runtime::StackTrace>,
/// Identifier of the network request associated with this entry.
#[serde(
rename = "networkRequestId",
default,
skip_serializing_if = "Option::is_none"
)]
pub network_request_id: Option<crate::protocol::network::RequestId>,
/// Identifier of the worker associated with this entry.
#[serde(rename = "workerId", default, skip_serializing_if = "Option::is_none")]
pub worker_id: Option<String>,
/// Call arguments.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub args: Option<Vec<crate::protocol::runtime::RemoteObject>>,
}
/// The values `source` accepts on `LogEntry`.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum LogEntrySource {
/// `xml`
#[serde(rename = "xml")]
Xml,
/// `javascript`
#[serde(rename = "javascript")]
Javascript,
/// `network`
#[serde(rename = "network")]
Network,
/// `storage`
#[serde(rename = "storage")]
Storage,
/// `appcache`
#[serde(rename = "appcache")]
Appcache,
/// `rendering`
#[serde(rename = "rendering")]
Rendering,
/// `security`
#[serde(rename = "security")]
Security,
/// `deprecation`
#[serde(rename = "deprecation")]
Deprecation,
/// `worker`
#[serde(rename = "worker")]
Worker,
/// `violation`
#[serde(rename = "violation")]
Violation,
/// `intervention`
#[serde(rename = "intervention")]
Intervention,
/// `recommendation`
#[serde(rename = "recommendation")]
Recommendation,
/// `other`
#[serde(rename = "other")]
Other,
/// A value this vendored schema does not list. Chrome adds values ahead of
/// the published protocol, so an unrecognised one is kept as it arrived
/// rather than failing the payload it came in.
#[serde(untagged)]
Unrecognized(String),
}
/// The values `level` accepts on `LogEntry`.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum LogEntryLevel {
/// `verbose`
#[serde(rename = "verbose")]
Verbose,
/// `info`
#[serde(rename = "info")]
Info,
/// `warning`
#[serde(rename = "warning")]
Warning,
/// `error`
#[serde(rename = "error")]
Error,
/// A value this vendored schema does not list. Chrome adds values ahead of
/// the published protocol, so an unrecognised one is kept as it arrived
/// rather than failing the payload it came in.
#[serde(untagged)]
Unrecognized(String),
}
/// The values `category` accepts on `LogEntry`.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum LogEntryCategory {
/// `cors`
#[serde(rename = "cors")]
Cors,
/// A value this vendored schema does not list. Chrome adds values ahead of
/// the published protocol, so an unrecognised one is kept as it arrived
/// rather than failing the payload it came in.
#[serde(untagged)]
Unrecognized(String),
}
/// Violation configuration setting.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ViolationSetting {
/// Violation type.
pub name: ViolationSettingName,
/// Time threshold to trigger upon.
pub threshold: f64,
}
/// The values `name` accepts on `ViolationSetting`.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ViolationSettingName {
/// `longTask`
#[serde(rename = "longTask")]
LongTask,
/// `longLayout`
#[serde(rename = "longLayout")]
LongLayout,
/// `blockedEvent`
#[serde(rename = "blockedEvent")]
BlockedEvent,
/// `blockedParser`
#[serde(rename = "blockedParser")]
BlockedParser,
/// `discouragedAPIUse`
#[serde(rename = "discouragedAPIUse")]
DiscouragedApiUse,
/// `handler`
#[serde(rename = "handler")]
Handler,
/// `recurringHandler`
#[serde(rename = "recurringHandler")]
RecurringHandler,
/// A value this vendored schema does not list. Chrome adds values ahead of
/// the published protocol, so an unrecognised one is kept as it arrived
/// rather than failing the payload it came in.
#[serde(untagged)]
Unrecognized(String),
}
/// Clears the log.
///
/// Parameters of `Log.clear`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ClearParams {}
impl crate::typed::Command for ClearParams {
const METHOD: &'static str = "Log.clear";
type Returns = crate::typed::NoReturns;
}
/// Disables log domain, prevents further log entries from being reported to
/// the client.
///
/// Parameters of `Log.disable`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DisableParams {}
impl crate::typed::Command for DisableParams {
const METHOD: &'static str = "Log.disable";
type Returns = crate::typed::NoReturns;
}
/// Enables log domain, sends the entries collected so far to the client by
/// means of the `entryAdded` notification.
///
/// Parameters of `Log.enable`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EnableParams {}
impl crate::typed::Command for EnableParams {
const METHOD: &'static str = "Log.enable";
type Returns = crate::typed::NoReturns;
}
/// start violation reporting.
///
/// Parameters of `Log.startViolationsReport`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct StartViolationsReportParams {
/// Configuration for violations.
pub config: Vec<ViolationSetting>,
}
impl crate::typed::Command for StartViolationsReportParams {
const METHOD: &'static str = "Log.startViolationsReport";
type Returns = crate::typed::NoReturns;
}
/// Stop violation reporting.
///
/// Parameters of `Log.stopViolationsReport`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct StopViolationsReportParams {}
impl crate::typed::Command for StopViolationsReportParams {
const METHOD: &'static str = "Log.stopViolationsReport";
type Returns = crate::typed::NoReturns;
}
/// Issued when new message was logged.
///
/// Payload of the `Log.entryAdded` event.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EntryAddedEvent {
/// The entry.
pub entry: LogEntry,
}
impl crate::typed::Event for EntryAddedEvent {
const METHOD: &'static str = "Log.entryAdded";
}