1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// @generated by `just generate-methods` from protocol/*.json.
// Do not edit by hand; edit xtask/ and regenerate.
//! Input/Output operations for streams produced by DevTools.
//!
//! Types, command parameters and event payloads for the `IO`
//! domain. The method-name constants for the same domain are in
//! [`crate::methods`].
use serde::{Deserialize, Serialize};
/// This is either obtained from another method or specified as
/// `blob:\<uuid\>` where `\<uuid\>` is an UUID of a Blob.
pub type StreamHandle = String;
/// Close the stream, discard any temporary backing storage.
///
/// Parameters of `IO.close`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct CloseParams {
/// Handle of the stream to close.
pub handle: StreamHandle,
}
impl crate::typed::Command for CloseParams {
const METHOD: &'static str = "IO.close";
type Returns = crate::typed::NoReturns;
}
/// Read a chunk of the stream
///
/// Parameters of `IO.read`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ReadParams {
/// Handle of the stream to read.
pub handle: StreamHandle,
/// Seek to the specified offset before reading (if not specified, proceed
/// with offset following the last read). Some types of streams may only
/// support sequential reads.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub offset: Option<i64>,
/// Maximum number of bytes to read (left upon the agent discretion if not
/// specified).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub size: Option<i64>,
}
/// What `IO.read` answers with.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ReadReturns {
/// Set if the data is base64-encoded
#[serde(
rename = "base64Encoded",
default,
skip_serializing_if = "Option::is_none"
)]
pub base64_encoded: Option<bool>,
/// Data that were read.
pub data: String,
/// Set if the end-of-file condition occurred while reading.
pub eof: bool,
}
impl crate::typed::Command for ReadParams {
const METHOD: &'static str = "IO.read";
type Returns = ReadReturns;
}
/// Return UUID of Blob object specified by a remote object id.
///
/// Deprecated in the protocol.
///
/// Parameters of `IO.resolveBlob`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ResolveBlobParams {
/// Object id of a Blob object wrapper.
#[serde(rename = "objectId")]
pub object_id: crate::protocol::runtime::RemoteObjectId,
}
/// What `IO.resolveBlob` answers with.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ResolveBlobReturns {
/// UUID of the specified Blob.
pub uuid: String,
}
impl crate::typed::Command for ResolveBlobParams {
const METHOD: &'static str = "IO.resolveBlob";
type Returns = ResolveBlobReturns;
}