MCPcopy Create free account
hub / github.com/aeroxy/chrome-devtools-cli / CdpClientTrait

Interface CdpClientTrait

src/cdp.rs:26–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24/// for future mock-based testing.
25#[allow(dead_code)]
26pub trait CdpClientTrait: Debug + Send {
27 fn send(
28 &mut self,
29 method: &str,
30 params: Value,
31 ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + '_>>;
32 fn send_to_target(
33 &mut self,
34 session_id: &str,
35 method: &str,
36 params: Value,
37 ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + '_>>;
38 fn current_url(
39 &mut self,
40 session_id: &str,
41 ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + '_>>;
42 fn resolve_page(
43 &mut self,
44 target: Option<&str>,
45 page: Option<usize>,
46 ) -> Pin<Box<dyn Future<Output = Result<TargetInfo>> + Send + '_>>;
47 fn attach_to_target(
48 &mut self,
49 target_id: &str,
50 ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + '_>>;
51 fn detach_from_target(
52 &mut self,
53 session_id: &str,
54 ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>;
55 fn activate_target(
56 &mut self,
57 target_id: &str,
58 ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>;
59 fn create_target(
60 &mut self,
61 url: &str,
62 ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + '_>>;
63 fn close_target(
64 &mut self,
65 target_id: &str,
66 ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>;
67 fn set_dialog_action(&mut self, action: Option<String>);
68}
69
70/// Concrete CDP client backed by a WebSocket connection.
71#[derive(Debug)]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected