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 `Inspector` domain.
//!
//! Types, command parameters and event payloads for the `Inspector`
//! 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};

/// Disables inspector domain notifications.
///
/// Parameters of `Inspector.disable`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DisableParams {}

impl crate::typed::Command for DisableParams {
    const METHOD: &'static str = "Inspector.disable";
    type Returns = crate::typed::NoReturns;
}

/// Enables inspector domain notifications.
///
/// Parameters of `Inspector.enable`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EnableParams {}

impl crate::typed::Command for EnableParams {
    const METHOD: &'static str = "Inspector.enable";
    type Returns = crate::typed::NoReturns;
}

/// Fired when remote debugging connection is about to be terminated. Contains
/// detach reason.
///
/// Payload of the `Inspector.detached` event.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DetachedEvent {
    /// The reason why connection has been terminated.
    pub reason: String,
}

impl crate::typed::Event for DetachedEvent {
    const METHOD: &'static str = "Inspector.detached";
}

/// Fired when debugging target has crashed
///
/// Payload of the `Inspector.targetCrashed` event.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TargetCrashedEvent {}

impl crate::typed::Event for TargetCrashedEvent {
    const METHOD: &'static str = "Inspector.targetCrashed";
}

/// Fired when debugging target has reloaded after crash
///
/// Payload of the `Inspector.targetReloadedAfterCrash` event.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TargetReloadedAfterCrashEvent {}

impl crate::typed::Event for TargetReloadedAfterCrashEvent {
    const METHOD: &'static str = "Inspector.targetReloadedAfterCrash";
}

/// Fired on worker targets when main worker script and any imported scripts
/// have been evaluated.
///
/// Experimental: may change without notice.
///
/// Payload of the `Inspector.workerScriptLoaded` event.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct WorkerScriptLoadedEvent {}

impl crate::typed::Event for WorkerScriptLoadedEvent {
    const METHOD: &'static str = "Inspector.workerScriptLoaded";
}