#dev-tools #chrome #cdp #build-tool #macro #auto-generate

build auto_generate_cdp

experimental crate to generate the Chrome Devtools Protocol

31 releases

0.4.4 Oct 28, 2023
0.4.2 Aug 1, 2023
0.4.1 Feb 2, 2023
0.4.0 Dec 27, 2022
0.2.9 May 23, 2021

#71 in Build Utils

Download history 3713/week @ 2023-12-14 2400/week @ 2023-12-21 2775/week @ 2023-12-28 4974/week @ 2024-01-04 5410/week @ 2024-01-11 4226/week @ 2024-01-18 4310/week @ 2024-01-25 4131/week @ 2024-02-01 3981/week @ 2024-02-08 3987/week @ 2024-02-15 3790/week @ 2024-02-22 3704/week @ 2024-02-29 4049/week @ 2024-03-07 4201/week @ 2024-03-14 4499/week @ 2024-03-21 3176/week @ 2024-03-28

16,596 downloads per month
Used in 27 crates (4 directly)

Custom license

135KB
1.5K SLoC

auto_generate_cdp

Docs Crates.io

An experimental crate to generate the Chrome Devtools Protocol.

Contributors

Usage

Add the following to your Cargo.toml:

[dependencies]
serde = {version = "1", features = ["derive"]}
serde_json = '1'

[build-dependencies]
auto_generate_cdp = {version = "0.4.4",default-features = false}

To generate the protocol, add the following to your build/build.rs script.

use auto_generate_cdp::init;

fn main() {
  init();
}

This will generate protocol.rs in your $OUT_DIR folder when you run $ cargo check or $ cargo build. Use like:

// src/protocol.rs

include!(concat!(env!("OUT_DIR"), "/protocol.rs"));

// src/main.rs

mod protocol;

fn main() {
  // protocol module contains the definitions now
}

Compiling behind a firewall

auto_generate_cdp needs to fetch files from raw.githubusercontent.com during compilation.

If for whatever reason you cannot access raw.githubusercontent.com directly (e.g. corporate firewall and/or internet censorship), you can try using a proxy server by setting any one of the following environment variables: https_proxy, http_proxy, ALL_PROXY. For example:

# proxy server uses curl format
https_proxy=http://localhost:8080 cargo build

Dependencies

~2.8–4.5MB
~110K SLoC