browser_protocol/tethering/
mod.rs1use serde::{Serialize, Deserialize};
5use serde_json::Value as JsonValue;
6use std::borrow::Cow;
7
8#[derive(Debug, Clone, Serialize, Deserialize, Default)]
11#[serde(rename_all = "camelCase")]
12pub struct BindParams {
13 port: i64,
15}
16
17impl BindParams {
18 pub fn builder(port: i64) -> BindParamsBuilder {
21 BindParamsBuilder {
22 port: port,
23 }
24 }
25 pub fn port(&self) -> i64 { self.port }
27}
28
29
30pub struct BindParamsBuilder {
31 port: i64,
32}
33
34impl BindParamsBuilder {
35 pub fn build(self) -> BindParams {
36 BindParams {
37 port: self.port,
38 }
39 }
40}
41
42impl BindParams { pub const METHOD: &'static str = "Tethering.bind"; }
43
44impl<'a> crate::CdpCommand<'a> for BindParams {
45 const METHOD: &'static str = "Tethering.bind";
46 type Response = crate::EmptyReturns;
47}
48
49#[derive(Debug, Clone, Serialize, Deserialize, Default)]
52#[serde(rename_all = "camelCase")]
53pub struct UnbindParams {
54 port: i64,
56}
57
58impl UnbindParams {
59 pub fn builder(port: i64) -> UnbindParamsBuilder {
62 UnbindParamsBuilder {
63 port: port,
64 }
65 }
66 pub fn port(&self) -> i64 { self.port }
68}
69
70
71pub struct UnbindParamsBuilder {
72 port: i64,
73}
74
75impl UnbindParamsBuilder {
76 pub fn build(self) -> UnbindParams {
77 UnbindParams {
78 port: self.port,
79 }
80 }
81}
82
83impl UnbindParams { pub const METHOD: &'static str = "Tethering.unbind"; }
84
85impl<'a> crate::CdpCommand<'a> for UnbindParams {
86 const METHOD: &'static str = "Tethering.unbind";
87 type Response = crate::EmptyReturns;
88}