rustenium_cdp_definitions/browser_protocol/service_worker/
events.rs1use serde::{Deserialize, Serialize};
2#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3pub struct WorkerErrorReportedParams {
4 #[serde(rename = "errorMessage")]
5 pub error_message: super::types::ServiceWorkerErrorMessage,
6}
7#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8pub enum WorkerErrorReportedMethod {
9 #[serde(rename = "ServiceWorker.workerErrorReported")]
10 WorkerErrorReported,
11}
12#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
13pub struct WorkerErrorReported {
14 pub method: WorkerErrorReportedMethod,
15 pub params: WorkerErrorReportedParams,
16}
17impl WorkerErrorReported {
18 pub const IDENTIFIER: &'static str = "ServiceWorker.workerErrorReported";
19 pub fn identifier(&self) -> &'static str {
20 Self::IDENTIFIER
21 }
22}
23#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
24pub struct WorkerRegistrationUpdatedParams {
25 #[serde(rename = "registrations")]
26 #[serde(skip_serializing_if = "Vec::is_empty")]
27 pub registrations: Vec<super::types::ServiceWorkerRegistration>,
28}
29#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
30pub enum WorkerRegistrationUpdatedMethod {
31 #[serde(rename = "ServiceWorker.workerRegistrationUpdated")]
32 WorkerRegistrationUpdated,
33}
34#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
35pub struct WorkerRegistrationUpdated {
36 pub method: WorkerRegistrationUpdatedMethod,
37 pub params: WorkerRegistrationUpdatedParams,
38}
39impl WorkerRegistrationUpdated {
40 pub const IDENTIFIER: &'static str = "ServiceWorker.workerRegistrationUpdated";
41 pub fn identifier(&self) -> &'static str {
42 Self::IDENTIFIER
43 }
44}
45#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
46pub struct WorkerVersionUpdatedParams {
47 #[serde(rename = "versions")]
48 #[serde(skip_serializing_if = "Vec::is_empty")]
49 pub versions: Vec<super::types::ServiceWorkerVersion>,
50}
51#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
52pub enum WorkerVersionUpdatedMethod {
53 #[serde(rename = "ServiceWorker.workerVersionUpdated")]
54 WorkerVersionUpdated,
55}
56#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
57pub struct WorkerVersionUpdated {
58 pub method: WorkerVersionUpdatedMethod,
59 pub params: WorkerVersionUpdatedParams,
60}
61impl WorkerVersionUpdated {
62 pub const IDENTIFIER: &'static str = "ServiceWorker.workerVersionUpdated";
63 pub fn identifier(&self) -> &'static str {
64 Self::IDENTIFIER
65 }
66}
67group_enum ! (ServiceWorkerEvents { WorkerErrorReported (WorkerErrorReported) , WorkerRegistrationUpdated (WorkerRegistrationUpdated) , WorkerVersionUpdated (WorkerVersionUpdated) } + identifiable);