Skip to main content

Crate zendriver_transport

Crate zendriver_transport 

Source
Expand description

Internal CDP transport for zendriver: WebSocket I/O, command/response routing, event broadcast.

Use via the zendriver crate’s re-exports. This crate is published so the workspace can compile end-to-end but its surface is not covered by the same SemVer guarantees as zendriver; expect minor versions to rearrange types here freely. See SEMVER.md in the repo root for the policy.

For a high-level walkthrough of the actor/observer model see the Architecture chapter of the zendriver-rs user guide.

§What lives here

  • Connection — cheap, clonable handle to the actor task. All Tabs and Elements hold one.
  • SessionHandle — a connection scoped to a particular CDP sessionId.
  • CdpCommand / CdpInbound / CdpRpcError / RawEvent — wire types.
  • TargetObserver — observer trait fired on Target.attachedToTarget before the debugger is released; used by zendriver-stealth to install patches on new pages.
  • CallError / TransportError — error types surfaced via zendriver’s ZendriverError::Transport / Cdp variants.

Re-exports§

pub use connection::Connection;
pub use connection::connect;
pub use connection::connect_with_observers;
pub use connection::spawn_actor;
pub use connection::spawn_actor_with_observers;
pub use error::CallError;
pub use error::TransportError;
pub use frame::CdpCommand;
pub use frame::CdpInbound;
pub use frame::CdpRpcError;
pub use frame::RawEvent;
pub use observer::ObserverError;
pub use observer::PausedSession;
pub use observer::TargetInfo;
pub use observer::TargetObserver;
pub use session::SessionHandle;

Modules§

actor
ConnectionActor: tokio task owning the WebSocket. Routes commands and responses by id, fans events out on a broadcast bus, and dispatches TargetObservers on Target.attachedToTarget.
connection
Connection — the public handle to the transport actor.
error
Transport-layer errors.
frame
CDP frame envelope types. Wraps chromiumoxide_cdp typed parameters with the id / method / session_id envelope CDP requires on the wire.
observer
TargetObserver trait — fires on each new attached target while the target is paused at the debugger.
session
SessionHandle: a Connection bound to a particular CDP sessionId. All commands sent through the handle are routed to that target.
testingtesting
Test-only helpers — gated behind cfg(any(test, feature = "testing")).