pub struct Connection { /* private fields */ }Expand description
Event-driven CDP WebSocket connection.
Spawns a background task that multiplexes outgoing CDP commands and incoming messages (responses → oneshot dispatch, events → broadcast).
Implementations§
Source§impl Connection
impl Connection
Sourcepub async fn call(
&self,
method: &str,
params: Value,
session_id: Option<&str>,
) -> Result<Value>
pub async fn call( &self, method: &str, params: Value, session_id: Option<&str>, ) -> Result<Value>
Send a CDP command and wait for the response.
If session_id is Some, the command is sent as a Target-scoped message;
if None, it is sent as a Browser-level message.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Connection
impl !UnwindSafe for Connection
impl Freeze for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnsafeUnpin for Connection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more