zendriver_transport/lib.rs
1//! Internal CDP transport for `zendriver`: WebSocket I/O, command/response
2//! routing, event broadcast.
3//!
4//! **Use via the `zendriver` crate's re-exports.** This crate is published so
5//! the workspace can compile end-to-end but its surface is not covered by the
6//! same SemVer guarantees as `zendriver`; expect minor versions to rearrange
7//! types here freely. See [`SEMVER.md`] in the repo root for the policy.
8//!
9//! For a high-level walkthrough of the actor/observer model see the
10//! [Architecture chapter](https://turtiesocks.github.io/zendriver-rs/architecture.html)
11//! of the [zendriver-rs user guide](https://turtiesocks.github.io/zendriver-rs/).
12//!
13//! # What lives here
14//!
15//! - [`Connection`] — cheap, clonable handle to the actor task. All `Tab`s
16//! and `Element`s hold one.
17//! - [`SessionHandle`] — a connection scoped to a particular CDP `sessionId`.
18//! - [`CdpCommand`] / [`CdpInbound`] / [`CdpRpcError`] / [`RawEvent`] — wire
19//! types.
20//! - [`TargetObserver`] — observer trait fired on `Target.attachedToTarget`
21//! before the debugger is released; used by `zendriver-stealth` to install
22//! patches on new pages.
23//! - [`CallError`] / [`TransportError`] — error types surfaced via
24//! `zendriver`'s `ZendriverError::Transport` / `Cdp` variants.
25//!
26//! [`SEMVER.md`]: https://github.com/TurtIeSocks/zendriver-rs/blob/main/SEMVER.md
27
28#![cfg_attr(docsrs, feature(doc_cfg))]
29
30pub mod actor;
31pub mod connection;
32pub mod error;
33pub mod frame;
34pub mod observer;
35pub mod session;
36
37#[cfg(any(test, feature = "testing"))]
38pub mod testing;
39
40// Re-exports added as types land in later Phase 1 tasks:
41pub use connection::{
42 Connection, connect, connect_with_observers, spawn_actor, spawn_actor_with_observers,
43};
44pub use error::{CallError, TransportError};
45pub use frame::{CdpCommand, CdpInbound, CdpRpcError, RawEvent};
46pub use observer::{ObserverError, PausedSession, TargetInfo, TargetObserver};
47pub use session::SessionHandle;