Skip to main content

cdp_driver/protocol/
find_in_page.rs

1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! This domain provides commands to trigger the "Find in page" feature.
5//!
6//! Types, command parameters and event payloads for the `FindInPage`
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/// Forwards `query` to the find-in-page facility, starting a new find
15/// session. Where exactly the search starts from is implementation-specific.
16///
17/// Parameters of `FindInPage.findFirst`.
18#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
19pub struct FindFirstParams {
20    pub query: String,
21}
22
23impl crate::typed::Command for FindFirstParams {
24    const METHOD: &'static str = "FindInPage.findFirst";
25    type Returns = crate::typed::NoReturns;
26}
27
28/// Moves to the next match for the query passed to the most recent
29/// findFirst() call.
30///
31/// Parameters of `FindInPage.findNext`.
32#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
33pub struct FindNextParams {}
34
35impl crate::typed::Command for FindNextParams {
36    const METHOD: &'static str = "FindInPage.findNext";
37    type Returns = crate::typed::NoReturns;
38}
39
40/// Moves to the previous match for the query passed to the most recent
41/// findFirst() call.
42///
43/// Parameters of `FindInPage.findPrev`.
44#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
45pub struct FindPrevParams {}
46
47impl crate::typed::Command for FindPrevParams {
48    const METHOD: &'static str = "FindInPage.findPrev";
49    type Returns = crate::typed::NoReturns;
50}
51
52/// Ends the current find session, if any, and clears its highlighting.
53///
54/// Parameters of `FindInPage.stop`.
55#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
56pub struct StopParams {}
57
58impl crate::typed::Command for StopParams {
59    const METHOD: &'static str = "FindInPage.stop";
60    type Returns = crate::typed::NoReturns;
61}