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.

//! This domain provides commands to trigger the "Find in page" feature.
//!
//! Types, command parameters and event payloads for the `FindInPage`
//! 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};

/// Forwards `query` to the find-in-page facility, starting a new find
/// session. Where exactly the search starts from is implementation-specific.
///
/// Parameters of `FindInPage.findFirst`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct FindFirstParams {
    pub query: String,
}

impl crate::typed::Command for FindFirstParams {
    const METHOD: &'static str = "FindInPage.findFirst";
    type Returns = crate::typed::NoReturns;
}

/// Moves to the next match for the query passed to the most recent
/// findFirst() call.
///
/// Parameters of `FindInPage.findNext`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct FindNextParams {}

impl crate::typed::Command for FindNextParams {
    const METHOD: &'static str = "FindInPage.findNext";
    type Returns = crate::typed::NoReturns;
}

/// Moves to the previous match for the query passed to the most recent
/// findFirst() call.
///
/// Parameters of `FindInPage.findPrev`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct FindPrevParams {}

impl crate::typed::Command for FindPrevParams {
    const METHOD: &'static str = "FindInPage.findPrev";
    type Returns = crate::typed::NoReturns;
}

/// Ends the current find session, if any, and clears its highlighting.
///
/// Parameters of `FindInPage.stop`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct StopParams {}

impl crate::typed::Command for StopParams {
    const METHOD: &'static str = "FindInPage.stop";
    type Returns = crate::typed::NoReturns;
}