Skip to main content

js_protocol/console/
mod.rs

1//! This domain is deprecated - use Runtime or Log instead.
2use serde::{Serialize, Deserialize};
3use serde_json::Value as JsonValue;
4
5/// Console message.
6
7#[derive(Debug, Clone, Serialize, Deserialize, Default)]
8#[serde(rename_all = "camelCase")]
9pub struct ConsoleMessage {
10    /// Message source.
11
12    pub source: String,
13    /// Message severity.
14
15    pub level: String,
16    /// Message text.
17
18    pub text: String,
19    /// URL of the message origin.
20
21    #[serde(skip_serializing_if = "Option::is_none")]
22    pub url: Option<String>,
23    /// Line number in the resource that generated this message (1-based).
24
25    #[serde(skip_serializing_if = "Option::is_none")]
26    pub line: Option<i64>,
27    /// Column number in the resource that generated this message (1-based).
28
29    #[serde(skip_serializing_if = "Option::is_none")]
30    pub column: Option<i64>,
31}
32
33#[derive(Debug, Clone, Serialize, Deserialize, Default)]
34pub struct ClearMessagesParams {}
35
36impl ClearMessagesParams { pub const METHOD: &'static str = "Console.clearMessages"; }
37
38impl crate::CdpCommand for ClearMessagesParams {
39    const METHOD: &'static str = "Console.clearMessages";
40    type Response = crate::EmptyReturns;
41}
42
43#[derive(Debug, Clone, Serialize, Deserialize, Default)]
44pub struct DisableParams {}
45
46impl DisableParams { pub const METHOD: &'static str = "Console.disable"; }
47
48impl crate::CdpCommand for DisableParams {
49    const METHOD: &'static str = "Console.disable";
50    type Response = crate::EmptyReturns;
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize, Default)]
54pub struct EnableParams {}
55
56impl EnableParams { pub const METHOD: &'static str = "Console.enable"; }
57
58impl crate::CdpCommand for EnableParams {
59    const METHOD: &'static str = "Console.enable";
60    type Response = crate::EmptyReturns;
61}