browser_commander/puppeteer/api/
connection_transport.rs1#![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 ConnectionTransport
15);
16
17impl ConnectionTransport {
18 pub async fn send(&self, message: &str) -> Result<(), BridgeError> {
24 self.remote.call("send", vec![Some(Value::from(message))]).await
25 }
26
27 pub async fn close(&self) -> Result<(), BridgeError> {
33 self.remote.call("close", vec![]).await
34 }
35}