viewpoint_cdp/protocol/page/
results.rs

1//! Page domain result types.
2
3use serde::Deserialize;
4
5use super::types::{FrameTree, NavigationEntry};
6
7/// Result of Page.navigate.
8#[derive(Debug, Clone, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub struct NavigateResult {
11    /// Frame id that has navigated (or failed to navigate).
12    pub frame_id: String,
13    /// Loader identifier.
14    pub loader_id: Option<String>,
15    /// User friendly error message if navigation failed.
16    pub error_text: Option<String>,
17}
18
19/// Result of Page.getFrameTree.
20#[derive(Debug, Clone, Deserialize)]
21#[serde(rename_all = "camelCase")]
22pub struct GetFrameTreeResult {
23    /// Frame tree structure.
24    pub frame_tree: FrameTree,
25}
26
27/// Result of Page.captureScreenshot.
28#[derive(Debug, Clone, Deserialize)]
29pub struct CaptureScreenshotResult {
30    /// Base64-encoded image data.
31    pub data: String,
32}
33
34/// Result of Page.printToPDF.
35#[derive(Debug, Clone, Deserialize)]
36pub struct PrintToPdfResult {
37    /// Base64-encoded pdf data.
38    pub data: String,
39    /// A handle of the stream that holds resulting PDF data.
40    pub stream: Option<String>,
41}
42
43/// Result of Page.goBack / Page.goForward.
44#[derive(Debug, Clone, Deserialize)]
45pub struct NavigationHistoryResult {}
46
47/// Result of Page.getNavigationHistory.
48#[derive(Debug, Clone, Deserialize)]
49#[serde(rename_all = "camelCase")]
50pub struct GetNavigationHistoryResult {
51    /// Index of the current navigation history entry.
52    pub current_index: i32,
53    /// Array of navigation history entries.
54    pub entries: Vec<NavigationEntry>,
55}
56
57/// Result of Page.addScriptToEvaluateOnNewDocument.
58#[derive(Debug, Clone, Deserialize)]
59pub struct AddScriptToEvaluateOnNewDocumentResult {
60    /// Identifier of the added script.
61    pub identifier: String,
62}
63
64/// Result of Page.createIsolatedWorld.
65#[derive(Debug, Clone, Deserialize)]
66#[serde(rename_all = "camelCase")]
67pub struct CreateIsolatedWorldResult {
68    /// Execution context of the isolated world.
69    pub execution_context_id: crate::protocol::runtime::ExecutionContextId,
70}