cdp-protocol 0.3.1

A Rust implementation of the Chrome DevTools Protocol
Documentation
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
// Auto-generated from Chrome at version 146.0.7680.165 domain: Animation
#![allow(dead_code)]
use super::dom;
use super::runtime;
#[allow(unused_imports)]
use super::types::*;
#[allow(unused_imports)]
use derive_builder::Builder;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
#[allow(unused_imports)]
use serde_json::Value as Json;
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub enum AnimationType {
    #[serde(rename = "CSSTransition")]
    CssTransition,
    #[serde(rename = "CSSAnimation")]
    CssAnimation,
    #[serde(rename = "WebAnimation")]
    WebAnimation,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Animation instance."]
pub struct Animation {
    #[serde(default)]
    #[doc = "`Animation`'s id."]
    pub id: String,
    #[serde(default)]
    #[doc = "`Animation`'s name."]
    pub name: String,
    #[serde(default)]
    #[doc = "`Animation`'s internal paused state."]
    pub paused_state: bool,
    #[serde(default)]
    #[doc = "`Animation`'s play state."]
    pub play_state: String,
    #[serde(default)]
    #[doc = "`Animation`'s playback rate."]
    pub playback_rate: JsFloat,
    #[serde(default)]
    #[doc = "`Animation`'s start time.\n Milliseconds for time based animations and\n percentage \\[0 - 100\\] for scroll driven animations\n (i.e. when viewOrScrollTimeline exists)."]
    pub start_time: JsFloat,
    #[serde(default)]
    #[doc = "`Animation`'s current time."]
    pub current_time: JsFloat,
    #[doc = "Animation type of `Animation`."]
    pub r#type: AnimationType,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "`Animation`'s source animation node."]
    pub source: Option<AnimationEffect>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "A unique ID for `Animation` representing the sources that triggered this CSS\n animation/transition."]
    pub css_id: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "View or scroll timeline"]
    pub view_or_scroll_timeline: Option<ViewOrScrollTimeline>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Timeline instance"]
pub struct ViewOrScrollTimeline {
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Scroll container node"]
    pub source_node_id: Option<dom::BackendNodeId>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Represents the starting scroll position of the timeline\n as a length offset in pixels from scroll origin."]
    pub start_offset: Option<JsFloat>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Represents the ending scroll position of the timeline\n as a length offset in pixels from scroll origin."]
    pub end_offset: Option<JsFloat>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "The element whose principal box's visibility in the\n scrollport defined the progress of the timeline.\n Does not exist for animations with ScrollTimeline"]
    pub subject_node_id: Option<dom::BackendNodeId>,
    #[doc = "Orientation of the scroll"]
    pub axis: dom::ScrollOrientation,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "AnimationEffect instance"]
pub struct AnimationEffect {
    #[serde(default)]
    #[doc = "`AnimationEffect`'s delay."]
    pub delay: JsFloat,
    #[serde(default)]
    #[doc = "`AnimationEffect`'s end delay."]
    pub end_delay: JsFloat,
    #[serde(default)]
    #[doc = "`AnimationEffect`'s iteration start."]
    pub iteration_start: JsFloat,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "`AnimationEffect`'s iterations. Omitted if the value is infinite."]
    pub iterations: Option<JsFloat>,
    #[serde(default)]
    #[doc = "`AnimationEffect`'s iteration duration.\n Milliseconds for time based animations and\n percentage \\[0 - 100\\] for scroll driven animations\n (i.e. when viewOrScrollTimeline exists)."]
    pub duration: JsFloat,
    #[serde(default)]
    #[doc = "`AnimationEffect`'s playback direction."]
    pub direction: String,
    #[serde(default)]
    #[doc = "`AnimationEffect`'s fill mode."]
    pub fill: String,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "`AnimationEffect`'s target node."]
    pub backend_node_id: Option<dom::BackendNodeId>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "`AnimationEffect`'s keyframes."]
    pub keyframes_rule: Option<KeyframesRule>,
    #[serde(default)]
    #[doc = "`AnimationEffect`'s timing function."]
    pub easing: String,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Keyframes Rule"]
pub struct KeyframesRule {
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "CSS keyframed animation's name."]
    pub name: Option<String>,
    #[doc = "List of animation keyframes."]
    pub keyframes: Vec<KeyframeStyle>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Keyframe Style"]
pub struct KeyframeStyle {
    #[serde(default)]
    #[doc = "Keyframe's time offset."]
    pub offset: String,
    #[serde(default)]
    #[doc = "`AnimationEffect`'s timing function."]
    pub easing: String,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub struct Disable(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub struct Enable(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Returns the current time of the an animation."]
pub struct GetCurrentTime {
    #[serde(default)]
    #[doc = "Id of animation."]
    pub id: String,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub struct GetPlaybackRate(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Releases a set of animations to no longer be manipulated."]
pub struct ReleaseAnimations {
    #[serde(default)]
    #[doc = "List of animation ids to seek."]
    pub animations: Vec<String>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Gets the remote object of the Animation."]
pub struct ResolveAnimation {
    #[serde(default)]
    #[doc = "Animation id."]
    pub animation_id: String,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Seek a set of animations to a particular time within each animation."]
pub struct SeekAnimations {
    #[serde(default)]
    #[doc = "List of animation ids to seek."]
    pub animations: Vec<String>,
    #[serde(default)]
    #[doc = "Set the current time of each animation."]
    pub current_time: JsFloat,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Sets the paused state of a set of animations."]
pub struct SetPaused {
    #[serde(default)]
    #[doc = "Animations to set the pause state of."]
    pub animations: Vec<String>,
    #[serde(default)]
    #[doc = "Paused state to set to."]
    pub paused: bool,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Sets the playback rate of the document timeline."]
pub struct SetPlaybackRate {
    #[serde(default)]
    #[doc = "Playback rate for animations on page"]
    pub playback_rate: JsFloat,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Sets the timing of an animation node."]
pub struct SetTiming {
    #[serde(default)]
    #[doc = "Animation id."]
    pub animation_id: String,
    #[serde(default)]
    #[doc = "Duration of the animation."]
    pub duration: JsFloat,
    #[serde(default)]
    #[doc = "Delay of the animation."]
    pub delay: JsFloat,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Disables animation domain notifications."]
pub struct DisableReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Enables animation domain notifications."]
pub struct EnableReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[serde(rename_all = "camelCase")]
#[doc = "Returns the current time of the an animation."]
pub struct GetCurrentTimeReturnObject {
    #[serde(default)]
    #[doc = "Current time of the page."]
    pub current_time: JsFloat,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[serde(rename_all = "camelCase")]
#[doc = "Gets the playback rate of the document timeline."]
pub struct GetPlaybackRateReturnObject {
    #[serde(default)]
    #[doc = "Playback rate for animations on page."]
    pub playback_rate: JsFloat,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Releases a set of animations to no longer be manipulated."]
pub struct ReleaseAnimationsReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[serde(rename_all = "camelCase")]
#[doc = "Gets the remote object of the Animation."]
pub struct ResolveAnimationReturnObject {
    #[doc = "Corresponding remote object."]
    pub remote_object: runtime::RemoteObject,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Seek a set of animations to a particular time within each animation."]
pub struct SeekAnimationsReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Sets the paused state of a set of animations."]
pub struct SetPausedReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Sets the playback rate of the document timeline."]
pub struct SetPlaybackRateReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Sets the timing of an animation node."]
pub struct SetTimingReturnObject(pub Option<Json>);
#[allow(deprecated)]
impl Method for Disable {
    const NAME: &'static str = "Animation.disable";
    type ReturnObject = DisableReturnObject;
}
#[allow(deprecated)]
impl Method for Enable {
    const NAME: &'static str = "Animation.enable";
    type ReturnObject = EnableReturnObject;
}
#[allow(deprecated)]
impl Method for GetCurrentTime {
    const NAME: &'static str = "Animation.getCurrentTime";
    type ReturnObject = GetCurrentTimeReturnObject;
}
#[allow(deprecated)]
impl Method for GetPlaybackRate {
    const NAME: &'static str = "Animation.getPlaybackRate";
    type ReturnObject = GetPlaybackRateReturnObject;
}
#[allow(deprecated)]
impl Method for ReleaseAnimations {
    const NAME: &'static str = "Animation.releaseAnimations";
    type ReturnObject = ReleaseAnimationsReturnObject;
}
#[allow(deprecated)]
impl Method for ResolveAnimation {
    const NAME: &'static str = "Animation.resolveAnimation";
    type ReturnObject = ResolveAnimationReturnObject;
}
#[allow(deprecated)]
impl Method for SeekAnimations {
    const NAME: &'static str = "Animation.seekAnimations";
    type ReturnObject = SeekAnimationsReturnObject;
}
#[allow(deprecated)]
impl Method for SetPaused {
    const NAME: &'static str = "Animation.setPaused";
    type ReturnObject = SetPausedReturnObject;
}
#[allow(deprecated)]
impl Method for SetPlaybackRate {
    const NAME: &'static str = "Animation.setPlaybackRate";
    type ReturnObject = SetPlaybackRateReturnObject;
}
#[allow(deprecated)]
impl Method for SetTiming {
    const NAME: &'static str = "Animation.setTiming";
    type ReturnObject = SetTimingReturnObject;
}
#[allow(dead_code)]
pub mod events {
    #[allow(unused_imports)]
    use super::super::types::*;
    #[allow(unused_imports)]
    use derive_builder::Builder;
    #[allow(unused_imports)]
    use serde::{Deserialize, Serialize};
    #[allow(unused_imports)]
    use serde_json::Value as Json;
    #[allow(deprecated)]
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
    pub struct AnimationCanceledEvent {
        pub params: AnimationCanceledEventParams,
    }
    #[allow(deprecated)]
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
    #[serde(rename_all = "camelCase")]
    pub struct AnimationCanceledEventParams {
        #[serde(default)]
        #[doc = "Id of the animation that was cancelled."]
        pub id: String,
    }
    #[allow(deprecated)]
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
    pub struct AnimationCreatedEvent {
        pub params: AnimationCreatedEventParams,
    }
    #[allow(deprecated)]
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
    #[serde(rename_all = "camelCase")]
    pub struct AnimationCreatedEventParams {
        #[serde(default)]
        #[doc = "Id of the animation that was created."]
        pub id: String,
    }
    #[allow(deprecated)]
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
    pub struct AnimationStartedEvent {
        pub params: AnimationStartedEventParams,
    }
    #[allow(deprecated)]
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
    #[serde(rename_all = "camelCase")]
    pub struct AnimationStartedEventParams {
        #[doc = "Animation that was started."]
        pub animation: super::Animation,
    }
    #[allow(deprecated)]
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
    pub struct AnimationUpdatedEvent {
        pub params: AnimationUpdatedEventParams,
    }
    #[allow(deprecated)]
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
    #[serde(rename_all = "camelCase")]
    pub struct AnimationUpdatedEventParams {
        #[doc = "Animation that was updated."]
        pub animation: super::Animation,
    }
}