Skip to main content

playhard_cdp/
lib.rs

1//! Typed Chrome DevTools Protocol helpers for Playhard.
2//!
3//! This crate intentionally owns the protocol shape and typed command surface,
4//! while leaving the actual transport boundary abstract. A future
5//! `playhard-transport` crate can implement the transport trait without
6//! changing the public CDP API.
7
8#![deny(missing_docs)]
9
10mod client;
11mod error;
12mod protocol;
13mod types;
14
15pub use client::{CdpClient, CdpTransport, Command};
16pub use error::{CdpError, Result};
17pub use protocol::{
18    BrowserGetVersionParams, BrowserGetVersionResult, BrowserVersion, FetchContinueRequestParams,
19    FetchEnableParams, FetchFailRequestParams, FetchFulfillRequestParams,
20    FetchGetResponseBodyParams, FetchGetResponseBodyResult, FetchHeaderEntry, FetchPattern,
21    InputDispatchKeyEventParams, InputInsertTextParams, NetworkEnableParams,
22    PageCaptureScreenshotParams, PageCaptureScreenshotResult, PageCreateIsolatedWorldParams,
23    PageCreateIsolatedWorldResult, PageEnableParams, PageFrame, PageFrameTree,
24    PageGetFrameTreeParams, PageGetFrameTreeResult, PageNavigateParams, PageNavigateResult,
25    PageSetLifecycleEventsEnabledParams, RemoteObject, RuntimeCallArgument,
26    RuntimeCallFunctionOnParams, RuntimeCallFunctionOnResult, RuntimeEnableParams,
27    RuntimeEvaluateParams, RuntimeEvaluateResult, RuntimeReleaseObjectParams,
28    TargetAttachToTargetParams, TargetAttachToTargetResult, TargetCreateTargetParams,
29    TargetCreateTargetResult, TargetSetAutoAttachParams, TargetSetDiscoverTargetsParams,
30};
31pub use types::{CdpRequest, CdpResponse, CdpResponseError, CdpValue, ResponseBody};
32
33/// Returns the embedded upstream protocol specification bundled with Playhard.
34pub fn protocol_spec() -> &'static str {
35    include_str!("../protocol/cdp-1.0.json")
36}