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
// @generated by `just generate-methods` from protocol/*.json.
// Do not edit by hand; edit xtask/ and regenerate.
//! This domain is deprecated - use Runtime or Log instead.
//!
//! Types, command parameters and event payloads for the `Console`
//! domain. The method-name constants for the same domain are in
//! [`crate::methods`].
//!
//! This domain is deprecated in the protocol.
use serde::{Deserialize, Serialize};
/// Console message.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ConsoleMessage {
/// Message source.
pub source: ConsoleMessageSource,
/// Message severity.
pub level: ConsoleMessageLevel,
/// Message text.
pub text: String,
/// URL of the message origin.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
/// Line number in the resource that generated this message (1-based).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub line: Option<i64>,
/// Column number in the resource that generated this message (1-based).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub column: Option<i64>,
}
/// The values `source` accepts on `ConsoleMessage`.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ConsoleMessageSource {
/// `xml`
#[serde(rename = "xml")]
Xml,
/// `javascript`
#[serde(rename = "javascript")]
Javascript,
/// `network`
#[serde(rename = "network")]
Network,
/// `console-api`
#[serde(rename = "console-api")]
ConsoleApi,
/// `storage`
#[serde(rename = "storage")]
Storage,
/// `appcache`
#[serde(rename = "appcache")]
Appcache,
/// `rendering`
#[serde(rename = "rendering")]
Rendering,
/// `security`
#[serde(rename = "security")]
Security,
/// `other`
#[serde(rename = "other")]
Other,
/// `deprecation`
#[serde(rename = "deprecation")]
Deprecation,
/// `worker`
#[serde(rename = "worker")]
Worker,
/// 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 `ConsoleMessage`.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ConsoleMessageLevel {
/// `log`
#[serde(rename = "log")]
Log,
/// `warning`
#[serde(rename = "warning")]
Warning,
/// `error`
#[serde(rename = "error")]
Error,
/// `debug`
#[serde(rename = "debug")]
Debug,
/// `info`
#[serde(rename = "info")]
Info,
/// 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),
}
/// Does nothing.
///
/// Parameters of `Console.clearMessages`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ClearMessagesParams {}
impl crate::typed::Command for ClearMessagesParams {
const METHOD: &'static str = "Console.clearMessages";
type Returns = crate::typed::NoReturns;
}
/// Disables console domain, prevents further console messages from being
/// reported to the client.
///
/// Parameters of `Console.disable`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DisableParams {}
impl crate::typed::Command for DisableParams {
const METHOD: &'static str = "Console.disable";
type Returns = crate::typed::NoReturns;
}
/// Enables console domain, sends the messages collected so far to the client
/// by means of the `messageAdded` notification.
///
/// Parameters of `Console.enable`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EnableParams {}
impl crate::typed::Command for EnableParams {
const METHOD: &'static str = "Console.enable";
type Returns = crate::typed::NoReturns;
}
/// Issued when new console message is added.
///
/// Payload of the `Console.messageAdded` event.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct MessageAddedEvent {
/// Console message that has been added.
pub message: ConsoleMessage,
}
impl crate::typed::Event for MessageAddedEvent {
const METHOD: &'static str = "Console.messageAdded";
}