Skip to main content

cdp_protocol/
system_info.rs

1// Auto-generated from Chrome at version 146.0.7680.165 domain: SystemInfo
2#![allow(dead_code)]
3#[allow(unused_imports)]
4use super::types::*;
5#[allow(unused_imports)]
6use derive_builder::Builder;
7#[allow(unused_imports)]
8use serde::{Deserialize, Serialize};
9#[allow(unused_imports)]
10use serde_json::Value as Json;
11#[allow(deprecated)]
12#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
13pub enum SubsamplingFormat {
14    #[serde(rename = "yuv420")]
15    Yuv420,
16    #[serde(rename = "yuv422")]
17    Yuv422,
18    #[serde(rename = "yuv444")]
19    Yuv444,
20}
21#[allow(deprecated)]
22#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
23pub enum ImageType {
24    #[serde(rename = "jpeg")]
25    Jpeg,
26    #[serde(rename = "webp")]
27    Webp,
28    #[serde(rename = "unknown")]
29    Unknown,
30}
31#[allow(deprecated)]
32#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
33#[builder(setter(into, strip_option))]
34#[serde(rename_all = "camelCase")]
35#[doc = "Describes a single graphics processor (GPU)."]
36pub struct GpuDevice {
37    #[serde(default)]
38    #[doc = "PCI ID of the GPU vendor, if available; 0 otherwise."]
39    pub vendor_id: JsFloat,
40    #[serde(default)]
41    #[doc = "PCI ID of the GPU device, if available; 0 otherwise."]
42    pub device_id: JsFloat,
43    #[builder(default)]
44    #[serde(skip_serializing_if = "Option::is_none")]
45    #[serde(default)]
46    #[doc = "Sub sys ID of the GPU, only available on Windows."]
47    pub sub_sys_id: Option<JsFloat>,
48    #[builder(default)]
49    #[serde(skip_serializing_if = "Option::is_none")]
50    #[serde(default)]
51    #[doc = "Revision of the GPU, only available on Windows."]
52    pub revision: Option<JsFloat>,
53    #[serde(default)]
54    #[doc = "String description of the GPU vendor, if the PCI ID is not available."]
55    pub vendor_string: String,
56    #[serde(default)]
57    #[doc = "String description of the GPU device, if the PCI ID is not available."]
58    pub device_string: String,
59    #[serde(default)]
60    #[doc = "String description of the GPU driver vendor."]
61    pub driver_vendor: String,
62    #[serde(default)]
63    #[doc = "String description of the GPU driver version."]
64    pub driver_version: String,
65}
66#[allow(deprecated)]
67#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
68#[builder(setter(into, strip_option))]
69#[serde(rename_all = "camelCase")]
70#[doc = "Describes the width and height dimensions of an entity."]
71pub struct Size {
72    #[serde(default)]
73    #[doc = "Width in pixels."]
74    pub width: JsUInt,
75    #[serde(default)]
76    #[doc = "Height in pixels."]
77    pub height: JsUInt,
78}
79#[allow(deprecated)]
80#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
81#[builder(setter(into, strip_option))]
82#[serde(rename_all = "camelCase")]
83#[doc = "Describes a supported video decoding profile with its associated minimum and\n maximum resolutions."]
84pub struct VideoDecodeAcceleratorCapability {
85    #[serde(default)]
86    #[doc = "Video codec profile that is supported, e.g. VP9 Profile 2."]
87    pub profile: String,
88    #[doc = "Maximum video dimensions in pixels supported for this |profile|."]
89    pub max_resolution: Size,
90    #[doc = "Minimum video dimensions in pixels supported for this |profile|."]
91    pub min_resolution: Size,
92}
93#[allow(deprecated)]
94#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
95#[builder(setter(into, strip_option))]
96#[serde(rename_all = "camelCase")]
97#[doc = "Describes a supported video encoding profile with its associated maximum\n resolution and maximum framerate."]
98pub struct VideoEncodeAcceleratorCapability {
99    #[serde(default)]
100    #[doc = "Video codec profile that is supported, e.g H264 Main."]
101    pub profile: String,
102    #[doc = "Maximum video dimensions in pixels supported for this |profile|."]
103    pub max_resolution: Size,
104    #[serde(default)]
105    #[doc = "Maximum encoding framerate in frames per second supported for this\n |profile|, as fraction's numerator and denominator, e.g. 24/1 fps,\n 24000/1001 fps, etc."]
106    pub max_framerate_numerator: JsUInt,
107    #[serde(default)]
108    pub max_framerate_denominator: JsUInt,
109}
110#[allow(deprecated)]
111#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
112#[builder(setter(into, strip_option))]
113#[serde(rename_all = "camelCase")]
114#[doc = "Provides information about the GPU(s) on the system."]
115pub struct GpuInfo {
116    #[doc = "The graphics devices on the system. Element 0 is the primary GPU."]
117    pub devices: Vec<GpuDevice>,
118    #[builder(default)]
119    #[serde(skip_serializing_if = "Option::is_none")]
120    #[serde(default)]
121    #[doc = "An optional dictionary of additional GPU related attributes."]
122    pub aux_attributes: Option<Json>,
123    #[builder(default)]
124    #[serde(skip_serializing_if = "Option::is_none")]
125    #[serde(default)]
126    #[doc = "An optional dictionary of graphics features and their status."]
127    pub feature_status: Option<Json>,
128    #[serde(default)]
129    #[doc = "An optional array of GPU driver bug workarounds."]
130    pub driver_bug_workarounds: Vec<String>,
131    #[doc = "Supported accelerated video decoding capabilities."]
132    pub video_decoding: Vec<VideoDecodeAcceleratorCapability>,
133    #[doc = "Supported accelerated video encoding capabilities."]
134    pub video_encoding: Vec<VideoEncodeAcceleratorCapability>,
135}
136#[allow(deprecated)]
137#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
138#[builder(setter(into, strip_option))]
139#[serde(rename_all = "camelCase")]
140#[doc = "Represents process info."]
141pub struct ProcessInfo {
142    #[serde(default)]
143    #[doc = "Specifies process type."]
144    pub r#type: String,
145    #[serde(default)]
146    #[doc = "Specifies process id."]
147    pub id: JsUInt,
148    #[serde(default)]
149    #[doc = "Specifies cumulative CPU usage in seconds across all threads of the\n process since the process start."]
150    pub cpu_time: JsFloat,
151}
152#[allow(deprecated)]
153#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
154pub struct GetInfo(pub Option<Json>);
155#[allow(deprecated)]
156#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
157#[builder(setter(into, strip_option))]
158#[serde(rename_all = "camelCase")]
159#[doc = "Returns information about the feature state."]
160pub struct GetFeatureState {
161    #[serde(default)]
162    pub feature_state: String,
163}
164#[allow(deprecated)]
165#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
166pub struct GetProcessInfo(pub Option<Json>);
167#[allow(deprecated)]
168#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
169#[serde(rename_all = "camelCase")]
170#[doc = "Returns information about the system."]
171pub struct GetInfoReturnObject {
172    #[doc = "Information about the GPUs on the system."]
173    pub gpu: GpuInfo,
174    #[serde(default)]
175    #[doc = "A platform-dependent description of the model of the machine. On Mac OS, this is, for\n example, 'MacBookPro'. Will be the empty string if not supported."]
176    pub model_name: String,
177    #[serde(default)]
178    #[doc = "A platform-dependent description of the version of the machine. On Mac OS, this is, for\n example, '10.1'. Will be the empty string if not supported."]
179    pub model_version: String,
180    #[serde(default)]
181    #[doc = "The command line string used to launch the browser. Will be the empty string if not\n supported."]
182    pub command_line: String,
183}
184#[allow(deprecated)]
185#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
186#[serde(rename_all = "camelCase")]
187#[doc = "Returns information about the feature state."]
188pub struct GetFeatureStateReturnObject {
189    #[serde(default)]
190    pub feature_enabled: bool,
191}
192#[allow(deprecated)]
193#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
194#[serde(rename_all = "camelCase")]
195#[doc = "Returns information about all running processes."]
196pub struct GetProcessInfoReturnObject {
197    #[doc = "An array of process info blocks."]
198    pub process_info: Vec<ProcessInfo>,
199}
200#[allow(deprecated)]
201impl Method for GetInfo {
202    const NAME: &'static str = "SystemInfo.getInfo";
203    type ReturnObject = GetInfoReturnObject;
204}
205#[allow(deprecated)]
206impl Method for GetFeatureState {
207    const NAME: &'static str = "SystemInfo.getFeatureState";
208    type ReturnObject = GetFeatureStateReturnObject;
209}
210#[allow(deprecated)]
211impl Method for GetProcessInfo {
212    const NAME: &'static str = "SystemInfo.getProcessInfo";
213    type ReturnObject = GetProcessInfoReturnObject;
214}
215#[allow(dead_code)]
216pub mod events {
217    #[allow(unused_imports)]
218    use super::super::types::*;
219    #[allow(unused_imports)]
220    use derive_builder::Builder;
221    #[allow(unused_imports)]
222    use serde::{Deserialize, Serialize};
223    #[allow(unused_imports)]
224    use serde_json::Value as Json;
225}