Skip to main content

browser_protocol/systeminfo/
mod.rs

1//! The SystemInfo domain defines methods and events for querying low-level system information.
2
3
4use serde::{Serialize, Deserialize};
5use serde_json::Value as JsonValue;
6use std::borrow::Cow;
7
8/// Describes a single graphics processor (GPU).
9
10#[derive(Debug, Clone, Serialize, Deserialize, Default)]
11#[serde(rename_all = "camelCase")]
12pub struct GPUDevice<'a> {
13    /// PCI ID of the GPU vendor, if available; 0 otherwise.
14    #[serde(rename = "vendorId")]
15    vendor_id: f64,
16    /// PCI ID of the GPU device, if available; 0 otherwise.
17    #[serde(rename = "deviceId")]
18    device_id: f64,
19    /// Sub sys ID of the GPU, only available on Windows.
20    #[serde(skip_serializing_if = "Option::is_none", rename = "subSysId")]
21    sub_sys_id: Option<f64>,
22    /// Revision of the GPU, only available on Windows.
23    #[serde(skip_serializing_if = "Option::is_none")]
24    revision: Option<f64>,
25    /// String description of the GPU vendor, if the PCI ID is not available.
26    #[serde(rename = "vendorString")]
27    vendor_string: Cow<'a, str>,
28    /// String description of the GPU device, if the PCI ID is not available.
29    #[serde(rename = "deviceString")]
30    device_string: Cow<'a, str>,
31    /// String description of the GPU driver vendor.
32    #[serde(rename = "driverVendor")]
33    driver_vendor: Cow<'a, str>,
34    /// String description of the GPU driver version.
35    #[serde(rename = "driverVersion")]
36    driver_version: Cow<'a, str>,
37}
38
39impl<'a> GPUDevice<'a> {
40    /// Creates a builder for this type with the required parameters:
41    /// * `vendor_id`: PCI ID of the GPU vendor, if available; 0 otherwise.
42    /// * `device_id`: PCI ID of the GPU device, if available; 0 otherwise.
43    /// * `vendor_string`: String description of the GPU vendor, if the PCI ID is not available.
44    /// * `device_string`: String description of the GPU device, if the PCI ID is not available.
45    /// * `driver_vendor`: String description of the GPU driver vendor.
46    /// * `driver_version`: String description of the GPU driver version.
47    pub fn builder(vendor_id: f64, device_id: f64, vendor_string: impl Into<Cow<'a, str>>, device_string: impl Into<Cow<'a, str>>, driver_vendor: impl Into<Cow<'a, str>>, driver_version: impl Into<Cow<'a, str>>) -> GPUDeviceBuilder<'a> {
48        GPUDeviceBuilder {
49            vendor_id: vendor_id,
50            device_id: device_id,
51            sub_sys_id: None,
52            revision: None,
53            vendor_string: vendor_string.into(),
54            device_string: device_string.into(),
55            driver_vendor: driver_vendor.into(),
56            driver_version: driver_version.into(),
57        }
58    }
59    /// PCI ID of the GPU vendor, if available; 0 otherwise.
60    pub fn vendor_id(&self) -> f64 { self.vendor_id }
61    /// PCI ID of the GPU device, if available; 0 otherwise.
62    pub fn device_id(&self) -> f64 { self.device_id }
63    /// Sub sys ID of the GPU, only available on Windows.
64    pub fn sub_sys_id(&self) -> Option<f64> { self.sub_sys_id }
65    /// Revision of the GPU, only available on Windows.
66    pub fn revision(&self) -> Option<f64> { self.revision }
67    /// String description of the GPU vendor, if the PCI ID is not available.
68    pub fn vendor_string(&self) -> &str { self.vendor_string.as_ref() }
69    /// String description of the GPU device, if the PCI ID is not available.
70    pub fn device_string(&self) -> &str { self.device_string.as_ref() }
71    /// String description of the GPU driver vendor.
72    pub fn driver_vendor(&self) -> &str { self.driver_vendor.as_ref() }
73    /// String description of the GPU driver version.
74    pub fn driver_version(&self) -> &str { self.driver_version.as_ref() }
75}
76
77
78pub struct GPUDeviceBuilder<'a> {
79    vendor_id: f64,
80    device_id: f64,
81    sub_sys_id: Option<f64>,
82    revision: Option<f64>,
83    vendor_string: Cow<'a, str>,
84    device_string: Cow<'a, str>,
85    driver_vendor: Cow<'a, str>,
86    driver_version: Cow<'a, str>,
87}
88
89impl<'a> GPUDeviceBuilder<'a> {
90    /// Sub sys ID of the GPU, only available on Windows.
91    pub fn sub_sys_id(mut self, sub_sys_id: f64) -> Self { self.sub_sys_id = Some(sub_sys_id); self }
92    /// Revision of the GPU, only available on Windows.
93    pub fn revision(mut self, revision: f64) -> Self { self.revision = Some(revision); self }
94    pub fn build(self) -> GPUDevice<'a> {
95        GPUDevice {
96            vendor_id: self.vendor_id,
97            device_id: self.device_id,
98            sub_sys_id: self.sub_sys_id,
99            revision: self.revision,
100            vendor_string: self.vendor_string,
101            device_string: self.device_string,
102            driver_vendor: self.driver_vendor,
103            driver_version: self.driver_version,
104        }
105    }
106}
107
108/// Describes the width and height dimensions of an entity.
109
110#[derive(Debug, Clone, Serialize, Deserialize, Default)]
111#[serde(rename_all = "camelCase")]
112pub struct Size {
113    /// Width in pixels.
114    width: u64,
115    /// Height in pixels.
116    height: i64,
117}
118
119impl Size {
120    /// Creates a builder for this type with the required parameters:
121    /// * `width`: Width in pixels.
122    /// * `height`: Height in pixels.
123    pub fn builder(width: u64, height: i64) -> SizeBuilder {
124        SizeBuilder {
125            width: width,
126            height: height,
127        }
128    }
129    /// Width in pixels.
130    pub fn width(&self) -> u64 { self.width }
131    /// Height in pixels.
132    pub fn height(&self) -> i64 { self.height }
133}
134
135
136pub struct SizeBuilder {
137    width: u64,
138    height: i64,
139}
140
141impl SizeBuilder {
142    pub fn build(self) -> Size {
143        Size {
144            width: self.width,
145            height: self.height,
146        }
147    }
148}
149
150/// Describes a supported video decoding profile with its associated minimum and
151/// maximum resolutions.
152
153#[derive(Debug, Clone, Serialize, Deserialize, Default)]
154#[serde(rename_all = "camelCase")]
155pub struct VideoDecodeAcceleratorCapability<'a> {
156    /// Video codec profile that is supported, e.g. VP9 Profile 2.
157    profile: Cow<'a, str>,
158    /// Maximum video dimensions in pixels supported for this |profile|.
159    #[serde(rename = "maxResolution")]
160    max_resolution: Size,
161    /// Minimum video dimensions in pixels supported for this |profile|.
162    #[serde(rename = "minResolution")]
163    min_resolution: Size,
164}
165
166impl<'a> VideoDecodeAcceleratorCapability<'a> {
167    /// Creates a builder for this type with the required parameters:
168    /// * `profile`: Video codec profile that is supported, e.g. VP9 Profile 2.
169    /// * `max_resolution`: Maximum video dimensions in pixels supported for this |profile|.
170    /// * `min_resolution`: Minimum video dimensions in pixels supported for this |profile|.
171    pub fn builder(profile: impl Into<Cow<'a, str>>, max_resolution: Size, min_resolution: Size) -> VideoDecodeAcceleratorCapabilityBuilder<'a> {
172        VideoDecodeAcceleratorCapabilityBuilder {
173            profile: profile.into(),
174            max_resolution: max_resolution,
175            min_resolution: min_resolution,
176        }
177    }
178    /// Video codec profile that is supported, e.g. VP9 Profile 2.
179    pub fn profile(&self) -> &str { self.profile.as_ref() }
180    /// Maximum video dimensions in pixels supported for this |profile|.
181    pub fn max_resolution(&self) -> &Size { &self.max_resolution }
182    /// Minimum video dimensions in pixels supported for this |profile|.
183    pub fn min_resolution(&self) -> &Size { &self.min_resolution }
184}
185
186
187pub struct VideoDecodeAcceleratorCapabilityBuilder<'a> {
188    profile: Cow<'a, str>,
189    max_resolution: Size,
190    min_resolution: Size,
191}
192
193impl<'a> VideoDecodeAcceleratorCapabilityBuilder<'a> {
194    pub fn build(self) -> VideoDecodeAcceleratorCapability<'a> {
195        VideoDecodeAcceleratorCapability {
196            profile: self.profile,
197            max_resolution: self.max_resolution,
198            min_resolution: self.min_resolution,
199        }
200    }
201}
202
203/// Describes a supported video encoding profile with its associated maximum
204/// resolution and maximum framerate.
205
206#[derive(Debug, Clone, Serialize, Deserialize, Default)]
207#[serde(rename_all = "camelCase")]
208pub struct VideoEncodeAcceleratorCapability<'a> {
209    /// Video codec profile that is supported, e.g H264 Main.
210    profile: Cow<'a, str>,
211    /// Maximum video dimensions in pixels supported for this |profile|.
212    #[serde(rename = "maxResolution")]
213    max_resolution: Size,
214    /// Maximum encoding framerate in frames per second supported for this
215    /// |profile|, as fraction's numerator and denominator, e.g. 24/1 fps,
216    /// 24000/1001 fps, etc.
217    #[serde(rename = "maxFramerateNumerator")]
218    max_framerate_numerator: i64,
219    #[serde(rename = "maxFramerateDenominator")]
220    max_framerate_denominator: i64,
221}
222
223impl<'a> VideoEncodeAcceleratorCapability<'a> {
224    /// Creates a builder for this type with the required parameters:
225    /// * `profile`: Video codec profile that is supported, e.g H264 Main.
226    /// * `max_resolution`: Maximum video dimensions in pixels supported for this |profile|.
227    /// * `max_framerate_numerator`: 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.
228    /// * `max_framerate_denominator`: 
229    pub fn builder(profile: impl Into<Cow<'a, str>>, max_resolution: Size, max_framerate_numerator: i64, max_framerate_denominator: i64) -> VideoEncodeAcceleratorCapabilityBuilder<'a> {
230        VideoEncodeAcceleratorCapabilityBuilder {
231            profile: profile.into(),
232            max_resolution: max_resolution,
233            max_framerate_numerator: max_framerate_numerator,
234            max_framerate_denominator: max_framerate_denominator,
235        }
236    }
237    /// Video codec profile that is supported, e.g H264 Main.
238    pub fn profile(&self) -> &str { self.profile.as_ref() }
239    /// Maximum video dimensions in pixels supported for this |profile|.
240    pub fn max_resolution(&self) -> &Size { &self.max_resolution }
241    /// Maximum encoding framerate in frames per second supported for this
242    /// |profile|, as fraction's numerator and denominator, e.g. 24/1 fps,
243    /// 24000/1001 fps, etc.
244    pub fn max_framerate_numerator(&self) -> i64 { self.max_framerate_numerator }
245    pub fn max_framerate_denominator(&self) -> i64 { self.max_framerate_denominator }
246}
247
248
249pub struct VideoEncodeAcceleratorCapabilityBuilder<'a> {
250    profile: Cow<'a, str>,
251    max_resolution: Size,
252    max_framerate_numerator: i64,
253    max_framerate_denominator: i64,
254}
255
256impl<'a> VideoEncodeAcceleratorCapabilityBuilder<'a> {
257    pub fn build(self) -> VideoEncodeAcceleratorCapability<'a> {
258        VideoEncodeAcceleratorCapability {
259            profile: self.profile,
260            max_resolution: self.max_resolution,
261            max_framerate_numerator: self.max_framerate_numerator,
262            max_framerate_denominator: self.max_framerate_denominator,
263        }
264    }
265}
266
267/// YUV subsampling type of the pixels of a given image.
268
269#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
270pub enum SubsamplingFormat {
271    #[default]
272    #[serde(rename = "yuv420")]
273    Yuv420,
274    #[serde(rename = "yuv422")]
275    Yuv422,
276    #[serde(rename = "yuv444")]
277    Yuv444,
278}
279
280/// Image format of a given image.
281
282#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
283pub enum ImageType {
284    #[default]
285    #[serde(rename = "jpeg")]
286    Jpeg,
287    #[serde(rename = "webp")]
288    Webp,
289    #[serde(rename = "unknown")]
290    Unknown,
291}
292
293/// Provides information about the GPU(s) on the system.
294
295#[derive(Debug, Clone, Serialize, Deserialize, Default)]
296#[serde(rename_all = "camelCase")]
297pub struct GPUInfo<'a> {
298    /// The graphics devices on the system. Element 0 is the primary GPU.
299    devices: Vec<GPUDevice<'a>>,
300    /// An optional dictionary of additional GPU related attributes.
301    #[serde(skip_serializing_if = "Option::is_none", rename = "auxAttributes")]
302    aux_attributes: Option<serde_json::Map<String, JsonValue>>,
303    /// An optional dictionary of graphics features and their status.
304    #[serde(skip_serializing_if = "Option::is_none", rename = "featureStatus")]
305    feature_status: Option<serde_json::Map<String, JsonValue>>,
306    /// An optional array of GPU driver bug workarounds.
307    #[serde(rename = "driverBugWorkarounds")]
308    driver_bug_workarounds: Vec<Cow<'a, str>>,
309    /// Supported accelerated video decoding capabilities.
310    #[serde(rename = "videoDecoding")]
311    video_decoding: Vec<VideoDecodeAcceleratorCapability<'a>>,
312    /// Supported accelerated video encoding capabilities.
313    #[serde(rename = "videoEncoding")]
314    video_encoding: Vec<VideoEncodeAcceleratorCapability<'a>>,
315}
316
317impl<'a> GPUInfo<'a> {
318    /// Creates a builder for this type with the required parameters:
319    /// * `devices`: The graphics devices on the system. Element 0 is the primary GPU.
320    /// * `driver_bug_workarounds`: An optional array of GPU driver bug workarounds.
321    /// * `video_decoding`: Supported accelerated video decoding capabilities.
322    /// * `video_encoding`: Supported accelerated video encoding capabilities.
323    pub fn builder(devices: Vec<GPUDevice<'a>>, driver_bug_workarounds: Vec<Cow<'a, str>>, video_decoding: Vec<VideoDecodeAcceleratorCapability<'a>>, video_encoding: Vec<VideoEncodeAcceleratorCapability<'a>>) -> GPUInfoBuilder<'a> {
324        GPUInfoBuilder {
325            devices: devices,
326            aux_attributes: None,
327            feature_status: None,
328            driver_bug_workarounds: driver_bug_workarounds,
329            video_decoding: video_decoding,
330            video_encoding: video_encoding,
331        }
332    }
333    /// The graphics devices on the system. Element 0 is the primary GPU.
334    pub fn devices(&self) -> &[GPUDevice<'a>] { &self.devices }
335    /// An optional dictionary of additional GPU related attributes.
336    pub fn aux_attributes(&self) -> Option<&serde_json::Map<String, JsonValue>> { self.aux_attributes.as_ref() }
337    /// An optional dictionary of graphics features and their status.
338    pub fn feature_status(&self) -> Option<&serde_json::Map<String, JsonValue>> { self.feature_status.as_ref() }
339    /// An optional array of GPU driver bug workarounds.
340    pub fn driver_bug_workarounds(&self) -> &[Cow<'a, str>] { &self.driver_bug_workarounds }
341    /// Supported accelerated video decoding capabilities.
342    pub fn video_decoding(&self) -> &[VideoDecodeAcceleratorCapability<'a>] { &self.video_decoding }
343    /// Supported accelerated video encoding capabilities.
344    pub fn video_encoding(&self) -> &[VideoEncodeAcceleratorCapability<'a>] { &self.video_encoding }
345}
346
347
348pub struct GPUInfoBuilder<'a> {
349    devices: Vec<GPUDevice<'a>>,
350    aux_attributes: Option<serde_json::Map<String, JsonValue>>,
351    feature_status: Option<serde_json::Map<String, JsonValue>>,
352    driver_bug_workarounds: Vec<Cow<'a, str>>,
353    video_decoding: Vec<VideoDecodeAcceleratorCapability<'a>>,
354    video_encoding: Vec<VideoEncodeAcceleratorCapability<'a>>,
355}
356
357impl<'a> GPUInfoBuilder<'a> {
358    /// An optional dictionary of additional GPU related attributes.
359    pub fn aux_attributes(mut self, aux_attributes: serde_json::Map<String, JsonValue>) -> Self { self.aux_attributes = Some(aux_attributes); self }
360    /// An optional dictionary of graphics features and their status.
361    pub fn feature_status(mut self, feature_status: serde_json::Map<String, JsonValue>) -> Self { self.feature_status = Some(feature_status); self }
362    pub fn build(self) -> GPUInfo<'a> {
363        GPUInfo {
364            devices: self.devices,
365            aux_attributes: self.aux_attributes,
366            feature_status: self.feature_status,
367            driver_bug_workarounds: self.driver_bug_workarounds,
368            video_decoding: self.video_decoding,
369            video_encoding: self.video_encoding,
370        }
371    }
372}
373
374/// Represents process info.
375
376#[derive(Debug, Clone, Serialize, Deserialize, Default)]
377#[serde(rename_all = "camelCase")]
378pub struct ProcessInfo<'a> {
379    /// Specifies process type.
380    #[serde(rename = "type")]
381    type_: Cow<'a, str>,
382    /// Specifies process id.
383    id: u64,
384    /// Specifies cumulative CPU usage in seconds across all threads of the
385    /// process since the process start.
386    #[serde(rename = "cpuTime")]
387    cpu_time: f64,
388}
389
390impl<'a> ProcessInfo<'a> {
391    /// Creates a builder for this type with the required parameters:
392    /// * `type_`: Specifies process type.
393    /// * `id`: Specifies process id.
394    /// * `cpu_time`: Specifies cumulative CPU usage in seconds across all threads of the process since the process start.
395    pub fn builder(type_: impl Into<Cow<'a, str>>, id: u64, cpu_time: f64) -> ProcessInfoBuilder<'a> {
396        ProcessInfoBuilder {
397            type_: type_.into(),
398            id: id,
399            cpu_time: cpu_time,
400        }
401    }
402    /// Specifies process type.
403    pub fn type_(&self) -> &str { self.type_.as_ref() }
404    /// Specifies process id.
405    pub fn id(&self) -> u64 { self.id }
406    /// Specifies cumulative CPU usage in seconds across all threads of the
407    /// process since the process start.
408    pub fn cpu_time(&self) -> f64 { self.cpu_time }
409}
410
411
412pub struct ProcessInfoBuilder<'a> {
413    type_: Cow<'a, str>,
414    id: u64,
415    cpu_time: f64,
416}
417
418impl<'a> ProcessInfoBuilder<'a> {
419    pub fn build(self) -> ProcessInfo<'a> {
420        ProcessInfo {
421            type_: self.type_,
422            id: self.id,
423            cpu_time: self.cpu_time,
424        }
425    }
426}
427
428/// Returns information about the system.
429
430#[derive(Debug, Clone, Serialize, Deserialize, Default)]
431#[serde(rename_all = "camelCase")]
432pub struct GetInfoReturns<'a> {
433    /// Information about the GPUs on the system.
434    gpu: GPUInfo<'a>,
435    /// A platform-dependent description of the model of the machine. On Mac OS, this is, for
436    /// example, 'MacBookPro'. Will be the empty string if not supported.
437    #[serde(rename = "modelName")]
438    model_name: Cow<'a, str>,
439    /// A platform-dependent description of the version of the machine. On Mac OS, this is, for
440    /// example, '10.1'. Will be the empty string if not supported.
441    #[serde(rename = "modelVersion")]
442    model_version: Cow<'a, str>,
443    /// The command line string used to launch the browser. Will be the empty string if not
444    /// supported.
445    #[serde(rename = "commandLine")]
446    command_line: Cow<'a, str>,
447}
448
449impl<'a> GetInfoReturns<'a> {
450    /// Creates a builder for this type with the required parameters:
451    /// * `gpu`: Information about the GPUs on the system.
452    /// * `model_name`: 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.
453    /// * `model_version`: 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.
454    /// * `command_line`: The command line string used to launch the browser. Will be the empty string if not supported.
455    pub fn builder(gpu: GPUInfo<'a>, model_name: impl Into<Cow<'a, str>>, model_version: impl Into<Cow<'a, str>>, command_line: impl Into<Cow<'a, str>>) -> GetInfoReturnsBuilder<'a> {
456        GetInfoReturnsBuilder {
457            gpu: gpu,
458            model_name: model_name.into(),
459            model_version: model_version.into(),
460            command_line: command_line.into(),
461        }
462    }
463    /// Information about the GPUs on the system.
464    pub fn gpu(&self) -> &GPUInfo<'a> { &self.gpu }
465    /// A platform-dependent description of the model of the machine. On Mac OS, this is, for
466    /// example, 'MacBookPro'. Will be the empty string if not supported.
467    pub fn model_name(&self) -> &str { self.model_name.as_ref() }
468    /// A platform-dependent description of the version of the machine. On Mac OS, this is, for
469    /// example, '10.1'. Will be the empty string if not supported.
470    pub fn model_version(&self) -> &str { self.model_version.as_ref() }
471    /// The command line string used to launch the browser. Will be the empty string if not
472    /// supported.
473    pub fn command_line(&self) -> &str { self.command_line.as_ref() }
474}
475
476
477pub struct GetInfoReturnsBuilder<'a> {
478    gpu: GPUInfo<'a>,
479    model_name: Cow<'a, str>,
480    model_version: Cow<'a, str>,
481    command_line: Cow<'a, str>,
482}
483
484impl<'a> GetInfoReturnsBuilder<'a> {
485    pub fn build(self) -> GetInfoReturns<'a> {
486        GetInfoReturns {
487            gpu: self.gpu,
488            model_name: self.model_name,
489            model_version: self.model_version,
490            command_line: self.command_line,
491        }
492    }
493}
494
495#[derive(Debug, Clone, Serialize, Deserialize, Default)]
496pub struct GetInfoParams {}
497
498impl GetInfoParams { pub const METHOD: &'static str = "SystemInfo.getInfo"; }
499
500impl<'a> crate::CdpCommand<'a> for GetInfoParams {
501    const METHOD: &'static str = "SystemInfo.getInfo";
502    type Response = GetInfoReturns<'a>;
503}
504
505/// Returns information about the feature state.
506
507#[derive(Debug, Clone, Serialize, Deserialize, Default)]
508#[serde(rename_all = "camelCase")]
509pub struct GetFeatureStateParams<'a> {
510    #[serde(rename = "featureState")]
511    feature_state: Cow<'a, str>,
512}
513
514impl<'a> GetFeatureStateParams<'a> {
515    /// Creates a builder for this type with the required parameters:
516    /// * `feature_state`: 
517    pub fn builder(feature_state: impl Into<Cow<'a, str>>) -> GetFeatureStateParamsBuilder<'a> {
518        GetFeatureStateParamsBuilder {
519            feature_state: feature_state.into(),
520        }
521    }
522    pub fn feature_state(&self) -> &str { self.feature_state.as_ref() }
523}
524
525
526pub struct GetFeatureStateParamsBuilder<'a> {
527    feature_state: Cow<'a, str>,
528}
529
530impl<'a> GetFeatureStateParamsBuilder<'a> {
531    pub fn build(self) -> GetFeatureStateParams<'a> {
532        GetFeatureStateParams {
533            feature_state: self.feature_state,
534        }
535    }
536}
537
538/// Returns information about the feature state.
539
540#[derive(Debug, Clone, Serialize, Deserialize, Default)]
541#[serde(rename_all = "camelCase")]
542pub struct GetFeatureStateReturns {
543    #[serde(rename = "featureEnabled")]
544    feature_enabled: bool,
545}
546
547impl GetFeatureStateReturns {
548    /// Creates a builder for this type with the required parameters:
549    /// * `feature_enabled`: 
550    pub fn builder(feature_enabled: bool) -> GetFeatureStateReturnsBuilder {
551        GetFeatureStateReturnsBuilder {
552            feature_enabled: feature_enabled,
553        }
554    }
555    pub fn feature_enabled(&self) -> bool { self.feature_enabled }
556}
557
558
559pub struct GetFeatureStateReturnsBuilder {
560    feature_enabled: bool,
561}
562
563impl GetFeatureStateReturnsBuilder {
564    pub fn build(self) -> GetFeatureStateReturns {
565        GetFeatureStateReturns {
566            feature_enabled: self.feature_enabled,
567        }
568    }
569}
570
571impl<'a> GetFeatureStateParams<'a> { pub const METHOD: &'static str = "SystemInfo.getFeatureState"; }
572
573impl<'a> crate::CdpCommand<'a> for GetFeatureStateParams<'a> {
574    const METHOD: &'static str = "SystemInfo.getFeatureState";
575    type Response = GetFeatureStateReturns;
576}
577
578/// Returns information about all running processes.
579
580#[derive(Debug, Clone, Serialize, Deserialize, Default)]
581#[serde(rename_all = "camelCase")]
582pub struct GetProcessInfoReturns<'a> {
583    /// An array of process info blocks.
584    #[serde(rename = "processInfo")]
585    process_info: Vec<ProcessInfo<'a>>,
586}
587
588impl<'a> GetProcessInfoReturns<'a> {
589    /// Creates a builder for this type with the required parameters:
590    /// * `process_info`: An array of process info blocks.
591    pub fn builder(process_info: Vec<ProcessInfo<'a>>) -> GetProcessInfoReturnsBuilder<'a> {
592        GetProcessInfoReturnsBuilder {
593            process_info: process_info,
594        }
595    }
596    /// An array of process info blocks.
597    pub fn process_info(&self) -> &[ProcessInfo<'a>] { &self.process_info }
598}
599
600
601pub struct GetProcessInfoReturnsBuilder<'a> {
602    process_info: Vec<ProcessInfo<'a>>,
603}
604
605impl<'a> GetProcessInfoReturnsBuilder<'a> {
606    pub fn build(self) -> GetProcessInfoReturns<'a> {
607        GetProcessInfoReturns {
608            process_info: self.process_info,
609        }
610    }
611}
612
613#[derive(Debug, Clone, Serialize, Deserialize, Default)]
614pub struct GetProcessInfoParams {}
615
616impl GetProcessInfoParams { pub const METHOD: &'static str = "SystemInfo.getProcessInfo"; }
617
618impl<'a> crate::CdpCommand<'a> for GetProcessInfoParams {
619    const METHOD: &'static str = "SystemInfo.getProcessInfo";
620    type Response = GetProcessInfoReturns<'a>;
621}