cdp-driver 0.5.0

Chrome DevTools Protocol (CDP) client for Rust: every command, event and type generated from the schema, with sessions, for browser automation and AI agents
Documentation
// @generated by `just generate-methods` from protocol/*.json.
// Do not edit by hand; edit xtask/ and regenerate.

//! The Tethering domain defines methods and events for browser port binding.
//!
//! Types, command parameters and event payloads for the `Tethering`
//! domain. The method-name constants for the same domain are in
//! [`crate::methods`].
//!
//! This domain is experimental and may change without notice.

use serde::{Deserialize, Serialize};

/// Request browser port binding.
///
/// Parameters of `Tethering.bind`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct BindParams {
    /// Port number to bind.
    pub port: i64,
}

impl crate::typed::Command for BindParams {
    const METHOD: &'static str = "Tethering.bind";
    type Returns = crate::typed::NoReturns;
}

/// Request browser port unbinding.
///
/// Parameters of `Tethering.unbind`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct UnbindParams {
    /// Port number to unbind.
    pub port: i64,
}

impl crate::typed::Command for UnbindParams {
    const METHOD: &'static str = "Tethering.unbind";
    type Returns = crate::typed::NoReturns;
}

/// Informs that port was successfully bound and got a specified connection
/// id.
///
/// Payload of the `Tethering.accepted` event.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct AcceptedEvent {
    /// Port number that was successfully bound.
    pub port: i64,
    /// Connection id to be used.
    #[serde(rename = "connectionId")]
    pub connection_id: String,
}

impl crate::typed::Event for AcceptedEvent {
    const METHOD: &'static str = "Tethering.accepted";
}