browser_commander/puppeteer/api/console_message.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 `ConsoleMessage` (puppeteer-core 25.10.0), a remote object
13 /// served by `browser-commander serve --stdio`.
14 ConsoleMessage
15);
16
17impl ConsoleMessage {
18 /// `ConsoleMessage.type`
19 ///
20 /// ```text
21 /// type(): ConsoleMessageType
22 /// ```
23 pub async fn r#type(&self) -> Result<String, BridgeError> {
24 self.remote.call("type", vec![]).await
25 }
26
27 /// `ConsoleMessage.text`
28 ///
29 /// ```text
30 /// text(): string
31 /// ```
32 pub async fn text(&self) -> Result<String, BridgeError> {
33 self.remote.call("text", vec![]).await
34 }
35
36 /// `ConsoleMessage.args`
37 ///
38 /// ```text
39 /// args(): JSHandle[]
40 /// ```
41 pub async fn args(&self) -> Result<Vec<JSHandle>, BridgeError> {
42 self.remote.call("args", vec![]).await
43 }
44
45 /// `ConsoleMessage.location`
46 ///
47 /// ```text
48 /// location(): ConsoleMessageLocation
49 /// ```
50 pub async fn location(&self) -> Result<Value, BridgeError> {
51 self.remote.call("location", vec![]).await
52 }
53
54 /// `ConsoleMessage.stackTrace`
55 ///
56 /// ```text
57 /// stackTrace(): ConsoleMessageLocation[]
58 /// ```
59 pub async fn stack_trace(&self) -> Result<Vec<Value>, BridgeError> {
60 self.remote.call("stackTrace", vec![]).await
61 }
62}