browser_protocol/io/
mod.rs1use serde::{Serialize, Deserialize};
3use serde_json::Value as JsonValue;
4
5pub type StreamHandle = String;
9
10#[derive(Debug, Clone, Serialize, Deserialize, Default)]
13#[serde(rename_all = "camelCase")]
14pub struct CloseParams {
15 pub handle: StreamHandle,
18}
19
20impl CloseParams { pub const METHOD: &'static str = "IO.close"; }
21
22impl crate::CdpCommand for CloseParams {
23 const METHOD: &'static str = "IO.close";
24 type Response = crate::EmptyReturns;
25}
26
27#[derive(Debug, Clone, Serialize, Deserialize, Default)]
30#[serde(rename_all = "camelCase")]
31pub struct ReadParams {
32 pub handle: StreamHandle,
35 #[serde(skip_serializing_if = "Option::is_none")]
39 pub offset: Option<i32>,
40 #[serde(skip_serializing_if = "Option::is_none")]
43 pub size: Option<u64>,
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize, Default)]
49#[serde(rename_all = "camelCase")]
50pub struct ReadReturns {
51 #[serde(skip_serializing_if = "Option::is_none")]
54 pub base64Encoded: Option<bool>,
55 pub data: String,
58 pub eof: bool,
61}
62
63impl ReadParams { pub const METHOD: &'static str = "IO.read"; }
64
65impl crate::CdpCommand for ReadParams {
66 const METHOD: &'static str = "IO.read";
67 type Response = ReadReturns;
68}
69
70#[derive(Debug, Clone, Serialize, Deserialize, Default)]
73#[serde(rename_all = "camelCase")]
74pub struct ResolveBlobParams {
75 pub objectId: crate::runtime::RemoteObjectId,
78}
79
80#[derive(Debug, Clone, Serialize, Deserialize, Default)]
83#[serde(rename_all = "camelCase")]
84pub struct ResolveBlobReturns {
85 pub uuid: String,
88}
89
90impl ResolveBlobParams { pub const METHOD: &'static str = "IO.resolveBlob"; }
91
92impl crate::CdpCommand for ResolveBlobParams {
93 const METHOD: &'static str = "IO.resolveBlob";
94 type Response = ResolveBlobReturns;
95}