Re-exports§
pub use bao_event::BaoEvent;pub use bao_event::ConsoleMessage;
Modules§
Structs§
- CdpError
- CDP error object.
- CdpEvent
- CDP event notification (no id field).
- CdpMessage
- Incoming CDP/JSON-RPC 2.0 request.
- CdpResponse
- Outgoing CDP/JSON-RPC 2.0 response.
- CdpServer
- CdpSession
- CDP client session. Holds a WebSocket connection and tracks enabled domains.
- Domain
Registry - Registry of CDP domain handlers. Thread-safe (Mutex-protected). Generic over handler type H — enables enum dispatch (H=DomainDispatch) for zero-vtable overhead.
- Empty
Handler - Empty handler used as the default registry type when no domains are needed.
CdpServer::new()creates aDomainRegistry<EmptyHandler>internally; production code should useCdpServer::with_registry()with a concrete handler type (e.g.DomainDispatch). - Event
Broadcaster - EventBroadcaster implements EventSender. It holds a reference to the session map and queues events into per-session outboxes; the server loop drains the outboxes into the WebSocket while holding the session lock.
- Server
Config - CDP server configuration. Controls bind address, timeouts, concurrency limits and version strings.
- Server
Config Builder - Session
Handle - Shared session handle: the session itself plus its outbound event queue.
- Target
Info - Browser Target information.
Enums§
- Session
Error - Session-level I/O error (replaces unit
()error types). - Session
State - Session lifecycle states (SM-CDP-SESSION).
Constants§
Traits§
- Domain
Handler - CDP Domain handler trait. Each implementation handles one CDP domain (e.g. Page, Runtime, DOM). All browser-specific logic lives here.
- Event
Sender - Event sender trait. Implemented internally by cdp-server, injected into DomainHandlers so they can broadcast CDP events.
- Registry
Dispatch - Type-erased dispatch trait. CdpServer holds
Arc<dyn RegistryDispatch>so it works with anyDomainRegistry<H>regardless of H. - Target
Provider - Browser target manager trait. Implemented by the backend (e.g. bao_cdp) to provide target discovery/creation/closure.
Functions§
- error_
response - is_
websocket_ upgrade - Parse the request to determine if it’s a WebSocket upgrade. Returns the pre-read bytes for replay.
- ok_
empty - ok_
response - parse_
activate_ request - parse_
close_ request - Parse HTTP path for target actions. Returns (action, target_id).
- parse_
message - parse_
new_ request - serialize_
event - serialize_
response
Type Aliases§
- Shared
Registry - Shared registry type used by CdpServer — type-erased via RegistryDispatch.