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
// @generated by `just generate-methods` from protocol/*.json.
// Do not edit by hand; edit xtask/ and regenerate.
//! The SystemInfo domain defines methods and events for querying low-level
//! system information.
//!
//! Types, command parameters and event payloads for the `SystemInfo`
//! domain. The method-name constants for the same domain are in
//! [`crate::methods`].
//!
//! This domain is experimental and may change without notice.
use serde::{Deserialize, Serialize};
/// Describes a single graphics processor (GPU).
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GpuDevice {
/// PCI ID of the GPU vendor, if available; 0 otherwise.
#[serde(rename = "vendorId")]
pub vendor_id: f64,
/// PCI ID of the GPU device, if available; 0 otherwise.
#[serde(rename = "deviceId")]
pub device_id: f64,
/// Sub sys ID of the GPU, only available on Windows.
#[serde(rename = "subSysId", default, skip_serializing_if = "Option::is_none")]
pub sub_sys_id: Option<f64>,
/// Revision of the GPU, only available on Windows.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub revision: Option<f64>,
/// String description of the GPU vendor, if the PCI ID is not available.
#[serde(rename = "vendorString")]
pub vendor_string: String,
/// String description of the GPU device, if the PCI ID is not available.
#[serde(rename = "deviceString")]
pub device_string: String,
/// String description of the GPU driver vendor.
#[serde(rename = "driverVendor")]
pub driver_vendor: String,
/// String description of the GPU driver version.
#[serde(rename = "driverVersion")]
pub driver_version: String,
}
/// Describes the width and height dimensions of an entity.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct Size {
/// Width in pixels.
pub width: i64,
/// Height in pixels.
pub height: i64,
}
/// Describes a supported video decoding profile with its associated minimum
/// and maximum resolutions.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct VideoDecodeAcceleratorCapability {
/// Video codec profile that is supported, e.g. VP9 Profile 2.
pub profile: String,
/// Maximum video dimensions in pixels supported for this |profile|.
#[serde(rename = "maxResolution")]
pub max_resolution: Size,
/// Minimum video dimensions in pixels supported for this |profile|.
#[serde(rename = "minResolution")]
pub min_resolution: Size,
}
/// Describes a supported video encoding profile with its associated maximum
/// resolution and maximum framerate.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct VideoEncodeAcceleratorCapability {
/// Video codec profile that is supported, e.g H264 Main.
pub profile: String,
/// Maximum video dimensions in pixels supported for this |profile|.
#[serde(rename = "maxResolution")]
pub max_resolution: Size,
/// Maximum encoding framerate in frames per second supported for this
/// |profile|, as fraction's numerator and denominator, e.g. 24/1 fps,
/// 24000/1001 fps, etc.
#[serde(rename = "maxFramerateNumerator")]
pub max_framerate_numerator: i64,
#[serde(rename = "maxFramerateDenominator")]
pub max_framerate_denominator: i64,
}
/// YUV subsampling type of the pixels of a given image.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum SubsamplingFormat {
/// `yuv420`
#[serde(rename = "yuv420")]
Yuv420,
/// `yuv422`
#[serde(rename = "yuv422")]
Yuv422,
/// `yuv444`
#[serde(rename = "yuv444")]
Yuv444,
/// 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),
}
/// Image format of a given image.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ImageType {
/// `jpeg`
#[serde(rename = "jpeg")]
Jpeg,
/// `webp`
#[serde(rename = "webp")]
Webp,
/// `unknown`
#[serde(rename = "unknown")]
Unknown,
/// 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),
}
/// Provides information about the GPU(s) on the system.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GpuInfo {
/// The graphics devices on the system. Element 0 is the primary GPU.
pub devices: Vec<GpuDevice>,
/// An optional dictionary of additional GPU related attributes.
#[serde(
rename = "auxAttributes",
default,
skip_serializing_if = "Option::is_none"
)]
pub aux_attributes: Option<serde_json::Value>,
/// An optional dictionary of graphics features and their status.
#[serde(
rename = "featureStatus",
default,
skip_serializing_if = "Option::is_none"
)]
pub feature_status: Option<serde_json::Value>,
/// An optional array of GPU driver bug workarounds.
#[serde(rename = "driverBugWorkarounds")]
pub driver_bug_workarounds: Vec<String>,
/// Supported accelerated video decoding capabilities.
#[serde(rename = "videoDecoding")]
pub video_decoding: Vec<VideoDecodeAcceleratorCapability>,
/// Supported accelerated video encoding capabilities.
#[serde(rename = "videoEncoding")]
pub video_encoding: Vec<VideoEncodeAcceleratorCapability>,
}
/// Represents process info.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ProcessInfo {
/// Specifies process type.
pub r#type: String,
/// Specifies process id.
pub id: i64,
/// Specifies cumulative CPU usage in seconds across all threads of the
/// process since the process start.
#[serde(rename = "cpuTime")]
pub cpu_time: f64,
}
/// Returns information about the system.
///
/// Parameters of `SystemInfo.getInfo`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetInfoParams {}
/// What `SystemInfo.getInfo` answers with.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetInfoReturns {
/// Information about the GPUs on the system.
pub gpu: GpuInfo,
/// A platform-dependent description of the model of the machine. On Mac OS,
/// this is, for example, 'MacBookPro'. Will be the empty string if not
/// supported.
#[serde(rename = "modelName")]
pub model_name: String,
/// A platform-dependent description of the version of the machine. On Mac OS,
/// this is, for example, '10.1'. Will be the empty string if not supported.
#[serde(rename = "modelVersion")]
pub model_version: String,
/// The command line string used to launch the browser. Will be the empty
/// string if not supported.
#[serde(rename = "commandLine")]
pub command_line: String,
}
impl crate::typed::Command for GetInfoParams {
const METHOD: &'static str = "SystemInfo.getInfo";
type Returns = GetInfoReturns;
}
/// Returns information about the feature state.
///
/// Parameters of `SystemInfo.getFeatureState`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetFeatureStateParams {
#[serde(rename = "featureState")]
pub feature_state: String,
}
/// What `SystemInfo.getFeatureState` answers with.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetFeatureStateReturns {
#[serde(rename = "featureEnabled")]
pub feature_enabled: bool,
}
impl crate::typed::Command for GetFeatureStateParams {
const METHOD: &'static str = "SystemInfo.getFeatureState";
type Returns = GetFeatureStateReturns;
}
/// Returns information about all running processes.
///
/// Parameters of `SystemInfo.getProcessInfo`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetProcessInfoParams {}
/// What `SystemInfo.getProcessInfo` answers with.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetProcessInfoReturns {
/// An array of process info blocks.
#[serde(rename = "processInfo")]
pub process_info: Vec<ProcessInfo>,
}
impl crate::typed::Command for GetProcessInfoParams {
const METHOD: &'static str = "SystemInfo.getProcessInfo";
type Returns = GetProcessInfoReturns;
}