Skip to main content

cdp_protocol/
io.rs

1// Auto-generated from Chrome at version 146.0.7680.165 domain: IO
2#![allow(dead_code)]
3use super::runtime;
4#[allow(unused_imports)]
5use super::types::*;
6#[allow(unused_imports)]
7use derive_builder::Builder;
8#[allow(unused_imports)]
9use serde::{Deserialize, Serialize};
10#[allow(unused_imports)]
11use serde_json::Value as Json;
12pub type StreamHandle = String;
13#[allow(deprecated)]
14#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
15#[builder(setter(into, strip_option))]
16#[serde(rename_all = "camelCase")]
17#[doc = "Close the stream, discard any temporary backing storage."]
18pub struct Close {
19    #[doc = "Handle of the stream to close."]
20    pub handle: StreamHandle,
21}
22#[allow(deprecated)]
23#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
24#[builder(setter(into, strip_option))]
25#[serde(rename_all = "camelCase")]
26#[doc = "Read a chunk of the stream"]
27pub struct Read {
28    #[doc = "Handle of the stream to read."]
29    pub handle: StreamHandle,
30    #[builder(default)]
31    #[serde(skip_serializing_if = "Option::is_none")]
32    #[serde(default)]
33    #[doc = "Seek to the specified offset before reading (if not specified, proceed with offset\n following the last read). Some types of streams may only support sequential reads."]
34    pub offset: Option<JsUInt>,
35    #[builder(default)]
36    #[serde(skip_serializing_if = "Option::is_none")]
37    #[serde(default)]
38    #[doc = "Maximum number of bytes to read (left upon the agent discretion if not specified)."]
39    pub size: Option<JsUInt>,
40}
41#[allow(deprecated)]
42#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
43#[builder(setter(into, strip_option))]
44#[serde(rename_all = "camelCase")]
45#[doc = "Return UUID of Blob object specified by a remote object id."]
46pub struct ResolveBlob {
47    #[doc = "Object id of a Blob object wrapper."]
48    pub object_id: runtime::RemoteObjectId,
49}
50#[allow(deprecated)]
51#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
52#[doc = "Close the stream, discard any temporary backing storage."]
53pub struct CloseReturnObject(pub Option<Json>);
54#[allow(deprecated)]
55#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
56#[serde(rename_all = "camelCase")]
57#[doc = "Read a chunk of the stream"]
58pub struct ReadReturnObject {
59    #[builder(default)]
60    #[serde(skip_serializing_if = "Option::is_none")]
61    #[serde(default)]
62    #[doc = "Set if the data is base64-encoded"]
63    pub base_64_encoded: Option<bool>,
64    #[serde(default)]
65    #[doc = "Data that were read."]
66    pub data: String,
67    #[serde(default)]
68    #[doc = "Set if the end-of-file condition occurred while reading."]
69    pub eof: bool,
70}
71#[allow(deprecated)]
72#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
73#[serde(rename_all = "camelCase")]
74#[doc = "Return UUID of Blob object specified by a remote object id."]
75pub struct ResolveBlobReturnObject {
76    #[serde(default)]
77    #[doc = "UUID of the specified Blob."]
78    pub uuid: String,
79}
80#[allow(deprecated)]
81impl Method for Close {
82    const NAME: &'static str = "IO.close";
83    type ReturnObject = CloseReturnObject;
84}
85#[allow(deprecated)]
86impl Method for Read {
87    const NAME: &'static str = "IO.read";
88    type ReturnObject = ReadReturnObject;
89}
90#[allow(deprecated)]
91impl Method for ResolveBlob {
92    const NAME: &'static str = "IO.resolveBlob";
93    type ReturnObject = ResolveBlobReturnObject;
94}
95#[allow(dead_code)]
96pub mod events {
97    #[allow(unused_imports)]
98    use super::super::types::*;
99    #[allow(unused_imports)]
100    use derive_builder::Builder;
101    #[allow(unused_imports)]
102    use serde::{Deserialize, Serialize};
103    #[allow(unused_imports)]
104    use serde_json::Value as Json;
105}