browser_commander/puppeteer/api/screen_recording.rs
1// @generated by scripts/generate-puppeteer-bindings.mjs from
2// rust/protocol/puppeteer/api.json. Do not edit by hand.
3
4#![allow(clippy::all, missing_docs, unused_imports, non_snake_case)]
5
6use serde_json::Value;
7
8use super::*;
9use crate::puppeteer::bridge::{binary, remote_type, BridgeError, JsFunction, Remote};
10
11remote_type!(
12 /// Puppeteer's `ScreenRecording` (puppeteer-core 25.10.0), a remote object
13 /// served by `browser-commander serve --stdio`.
14 ScreenRecording
15);
16
17impl ScreenRecording {
18 /// `ScreenRecording.pipe`
19 ///
20 /// ```text
21 /// pipe<T extends WritableStream<Uint8Array>>(destination: T): Promise<void>
22 /// pipe<T extends WritableDestination>(destination: T): T
23 /// ```
24 pub async fn pipe(&self, destination: Value) -> Result<Value, BridgeError> {
25 self.remote.call("pipe", vec![Some(destination)]).await
26 }
27
28 /// `ScreenRecording.stop`
29 ///
30 /// ```text
31 /// stop(): Promise<void>
32 /// ```
33 pub async fn stop(&self) -> Result<(), BridgeError> {
34 self.remote.call("stop", vec![]).await
35 }
36}