browser-protocol-0.1.3 has been yanked.
browser-protocol
A high-performance, fully type-safe Rust client for the Chrome DevTools Protocol (CDP), automatically generated from the official protocol definitions.
🚀 Features
- Full Coverage: Includes types, commands, and events for all CDP domains.
- Fluent Builders: Build commands easily with ergonomic builder APIs.
- Required-Argument Safety: Required parameters are enforced directly in the
.builder(...)constructor, ensuring compile-time protocol compliance. - Zero-Allocation: Leverages
Cow<'a, str>for string properties to avoid heap allocation overhead. - Encapsulated & Safe: Struct fields are private, exposing read-only access through compact getter methods.
- Clean Serialization: Automatically omits optional
Nonefields from serialized payloads to reduce network bandwidth. - Zero Warnings: Crate is compiled warning-free with inline Rustdoc comments from official schemas.
📦 Installation
Add this to your Cargo.toml:
[]
= { = "0.1.2", = ["full"] }
= { = "1.0", = ["derive"] }
= "1.0"
🛠 Usage Example
1. Constructing commands with parameters (e.g. Page.navigate)
Required fields are passed directly to builder(...), while optional fields are chained:
use ;
2. Constructing commands with no parameters (e.g. Browser.getVersion)
No builder boilerplate is generated or needed; just use default():
use GetVersionParams;
🏗 How it was built
This crate is automatically generated using a custom Python script that parses the browser_protocol.json and produces idiomatic Rust modules.
⚖ License
Distributed under the MIT License. See LICENSE for more information.
Disclaimer: This is an automatically generated project. Always check the official CDP documentation for the latest protocol changes.