pub struct CdpClient { /* private fields */ }Implementations§
Source§impl CdpClient
impl CdpClient
Sourcepub async fn connect(ws_url: &str) -> Result<Self>
pub async fn connect(ws_url: &str) -> Result<Self>
Connect by full WebSocket URL (ws:// or wss://).
Sourcepub async fn connect_http(base_url: &str) -> Result<Self>
pub async fn connect_http(base_url: &str) -> Result<Self>
Connect by HTTP base URL (e.g. http://127.0.0.1:9222). Fetches /json/version to discover the WS URL.
Sourcepub async fn send(&self, method: &str, params: Value) -> Result<Value>
pub async fn send(&self, method: &str, params: Value) -> Result<Value>
Send a method on the root browser-level session.
pub async fn send_with_session( &self, method: &str, params: Value, session_id: Option<&str>, ) -> Result<Value>
Sourcepub fn subscribe(&self) -> Receiver<CdpEvent>
pub fn subscribe(&self) -> Receiver<CdpEvent>
Subscribe to all events. Drop the receiver to unsubscribe.
Sourcepub async fn attach_to_target(&self, target_id: &str) -> Result<String>
pub async fn attach_to_target(&self, target_id: &str) -> Result<String>
Attach to a target via Target.attachToTarget(flatten=true) and return the session id.
Sourcepub async fn list_targets(&self) -> Result<Vec<Value>>
pub async fn list_targets(&self) -> Result<Vec<Value>>
Convenience: list targets via Target.getTargets.
Fetch the browser’s full cookie jar across Chromium versions.
Modern Chromium exposes browser-wide cookie export as
Storage.getCookies on the browser endpoint. Older builds and some
protocol surfaces only exposed the deprecated Network method, either
on the browser endpoint or through an attached page session.
Auto Trait Implementations§
impl !Freeze for CdpClient
impl !RefUnwindSafe for CdpClient
impl !UnwindSafe for CdpClient
impl Send for CdpClient
impl Sync for CdpClient
impl Unpin for CdpClient
impl UnsafeUnpin for CdpClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more