browser_protocol/deviceorientation/
mod.rs1use serde::{Serialize, Deserialize};
2use serde_json::Value as JsonValue;
3use std::borrow::Cow;
4
5#[derive(Debug, Clone, Serialize, Deserialize, Default)]
6pub struct ClearDeviceOrientationOverrideParams {}
7
8impl ClearDeviceOrientationOverrideParams { pub const METHOD: &'static str = "DeviceOrientation.clearDeviceOrientationOverride"; }
9
10impl<'a> crate::CdpCommand<'a> for ClearDeviceOrientationOverrideParams {
11 const METHOD: &'static str = "DeviceOrientation.clearDeviceOrientationOverride";
12 type Response = crate::EmptyReturns;
13}
14
15#[derive(Debug, Clone, Serialize, Deserialize, Default)]
18#[serde(rename_all = "camelCase")]
19pub struct SetDeviceOrientationOverrideParams {
20 alpha: f64,
22 beta: f64,
24 gamma: f64,
26}
27
28impl SetDeviceOrientationOverrideParams {
29 pub fn builder(alpha: f64, beta: f64, gamma: f64) -> SetDeviceOrientationOverrideParamsBuilder {
34 SetDeviceOrientationOverrideParamsBuilder {
35 alpha: alpha,
36 beta: beta,
37 gamma: gamma,
38 }
39 }
40 pub fn alpha(&self) -> f64 { self.alpha }
42 pub fn beta(&self) -> f64 { self.beta }
44 pub fn gamma(&self) -> f64 { self.gamma }
46}
47
48
49pub struct SetDeviceOrientationOverrideParamsBuilder {
50 alpha: f64,
51 beta: f64,
52 gamma: f64,
53}
54
55impl SetDeviceOrientationOverrideParamsBuilder {
56 pub fn build(self) -> SetDeviceOrientationOverrideParams {
57 SetDeviceOrientationOverrideParams {
58 alpha: self.alpha,
59 beta: self.beta,
60 gamma: self.gamma,
61 }
62 }
63}
64
65impl SetDeviceOrientationOverrideParams { pub const METHOD: &'static str = "DeviceOrientation.setDeviceOrientationOverride"; }
66
67impl<'a> crate::CdpCommand<'a> for SetDeviceOrientationOverrideParams {
68 const METHOD: &'static str = "DeviceOrientation.setDeviceOrientationOverride";
69 type Response = crate::EmptyReturns;
70}