Skip to main content

rustenium_cdp_definitions/browser_protocol/performance_timeline/
commands.rs

1use serde::{Deserialize, Serialize};
2#[doc = "Previously buffered events would be reported before method returns.\nSee also: timelineEventAdded\n[enable](https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline/#method-enable)"]
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct EnableParams {
5    #[doc = "The types of event to report, as specified in\nhttps://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype\nThe specified filter overrides any previous filters, passing empty\nfilter disables recording.\nNote that not all types exposed to the web platform are currently supported."]
6    #[serde(rename = "eventTypes")]
7    #[serde(skip_serializing_if = "Vec::is_empty")]
8    pub event_types: Vec<String>,
9}
10impl EnableParams {
11    pub fn new(event_types: Vec<String>) -> Self {
12        Self { event_types }
13    }
14}
15#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
16pub enum EnableMethod {
17    #[serde(rename = "PerformanceTimeline.enable")]
18    Enable,
19}
20#[doc = "Previously buffered events would be reported before method returns.\nSee also: timelineEventAdded\n[enable](https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline/#method-enable)"]
21#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
22pub struct Enable {
23    pub method: EnableMethod,
24    pub params: EnableParams,
25}
26impl Enable {
27    pub const IDENTIFIER: &'static str = "PerformanceTimeline.enable";
28    pub fn identifier(&self) -> &'static str {
29        Self::IDENTIFIER
30    }
31}
32impl crate::CommandResult for Enable {
33    type Result = super::results::EnableResult;
34}
35group_enum ! (PerformanceTimelineCommands { Enable (Enable) } + identifiable);