cdp_driver/protocol/
cast.rs1use serde::{Deserialize, Serialize};
14
15#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
16pub struct Sink {
17 pub name: String,
18 pub id: String,
19 #[serde(default, skip_serializing_if = "Option::is_none")]
22 pub session: Option<String>,
23}
24
25#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
32pub struct EnableParams {
33 #[serde(
34 rename = "presentationUrl",
35 default,
36 skip_serializing_if = "Option::is_none"
37 )]
38 pub presentation_url: Option<String>,
39}
40
41impl crate::typed::Command for EnableParams {
42 const METHOD: &'static str = "Cast.enable";
43 type Returns = crate::typed::NoReturns;
44}
45
46#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
50pub struct DisableParams {}
51
52impl crate::typed::Command for DisableParams {
53 const METHOD: &'static str = "Cast.disable";
54 type Returns = crate::typed::NoReturns;
55}
56
57#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
62pub struct SetSinkToUseParams {
63 #[serde(rename = "sinkName")]
64 pub sink_name: String,
65}
66
67impl crate::typed::Command for SetSinkToUseParams {
68 const METHOD: &'static str = "Cast.setSinkToUse";
69 type Returns = crate::typed::NoReturns;
70}
71
72#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
76pub struct StartDesktopMirroringParams {
77 #[serde(rename = "sinkName")]
78 pub sink_name: String,
79}
80
81impl crate::typed::Command for StartDesktopMirroringParams {
82 const METHOD: &'static str = "Cast.startDesktopMirroring";
83 type Returns = crate::typed::NoReturns;
84}
85
86#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
90pub struct StartTabMirroringParams {
91 #[serde(rename = "sinkName")]
92 pub sink_name: String,
93}
94
95impl crate::typed::Command for StartTabMirroringParams {
96 const METHOD: &'static str = "Cast.startTabMirroring";
97 type Returns = crate::typed::NoReturns;
98}
99
100#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
104pub struct StopCastingParams {
105 #[serde(rename = "sinkName")]
106 pub sink_name: String,
107}
108
109impl crate::typed::Command for StopCastingParams {
110 const METHOD: &'static str = "Cast.stopCasting";
111 type Returns = crate::typed::NoReturns;
112}
113
114#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
119pub struct SinksUpdatedEvent {
120 pub sinks: Vec<Sink>,
121}
122
123impl crate::typed::Event for SinksUpdatedEvent {
124 const METHOD: &'static str = "Cast.sinksUpdated";
125}
126
127#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
132pub struct IssueUpdatedEvent {
133 #[serde(rename = "issueMessage")]
134 pub issue_message: String,
135}
136
137impl crate::typed::Event for IssueUpdatedEvent {
138 const METHOD: &'static str = "Cast.issueUpdated";
139}