viewpoint_cdp/protocol/page/
types.rs1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct Frame {
9 pub id: String,
11 pub parent_id: Option<String>,
13 pub loader_id: String,
15 pub name: Option<String>,
17 pub url: String,
19 pub security_origin: Option<String>,
21 pub mime_type: Option<String>,
23}
24
25#[derive(Debug, Clone, Deserialize)]
27#[serde(rename_all = "camelCase")]
28pub struct FrameTree {
29 pub frame: Frame,
31 pub child_frames: Option<Vec<FrameTree>>,
33}
34
35#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Default)]
37#[serde(rename_all = "lowercase")]
38pub enum ScreenshotFormat {
39 #[default]
41 Png,
42 Jpeg,
44 Webp,
46}
47
48#[derive(Debug, Clone, Serialize)]
50#[serde(rename_all = "camelCase")]
51pub struct Viewport {
52 pub x: f64,
54 pub y: f64,
56 pub width: f64,
58 pub height: f64,
60 pub scale: f64,
62}
63
64#[derive(Debug, Clone, Deserialize)]
66#[serde(rename_all = "camelCase")]
67pub struct NavigationEntry {
68 pub id: i32,
70 pub url: String,
72 #[serde(default)]
74 pub user_typed_url: String,
75 pub title: String,
77 #[serde(default)]
79 pub transition_type: String,
80}
81
82#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]
84#[serde(rename_all = "camelCase")]
85pub enum FrameDetachedReason {
86 Remove,
88 Swap,
90}
91
92#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]
94#[serde(rename_all = "camelCase")]
95pub enum FileChooserMode {
96 SelectSingle,
98 SelectMultiple,
100}