Skip to main content

cdp_driver/protocol/
tethering.rs

1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! The Tethering domain defines methods and events for browser port binding.
5//!
6//! Types, command parameters and event payloads for the `Tethering`
7//! domain. The method-name constants for the same domain are in
8//! [`crate::methods`].
9//!
10//! This domain is experimental and may change without notice.
11
12use serde::{Deserialize, Serialize};
13
14/// Request browser port binding.
15///
16/// Parameters of `Tethering.bind`.
17#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
18pub struct BindParams {
19    /// Port number to bind.
20    pub port: i64,
21}
22
23impl crate::typed::Command for BindParams {
24    const METHOD: &'static str = "Tethering.bind";
25    type Returns = crate::typed::NoReturns;
26}
27
28/// Request browser port unbinding.
29///
30/// Parameters of `Tethering.unbind`.
31#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
32pub struct UnbindParams {
33    /// Port number to unbind.
34    pub port: i64,
35}
36
37impl crate::typed::Command for UnbindParams {
38    const METHOD: &'static str = "Tethering.unbind";
39    type Returns = crate::typed::NoReturns;
40}
41
42/// Informs that port was successfully bound and got a specified connection
43/// id.
44///
45/// Payload of the `Tethering.accepted` event.
46#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
47pub struct AcceptedEvent {
48    /// Port number that was successfully bound.
49    pub port: i64,
50    /// Connection id to be used.
51    #[serde(rename = "connectionId")]
52    pub connection_id: String,
53}
54
55impl crate::typed::Event for AcceptedEvent {
56    const METHOD: &'static str = "Tethering.accepted";
57}