Crates.io | auto_generate_cdp |
lib.rs | auto_generate_cdp |
version | 0.4.4 |
source | src |
created_at | 2021-04-29 15:33:57.529366 |
updated_at | 2023-10-28 06:33:03.814999 |
description | experimental crate to generate the Chrome Devtools Protocol. |
homepage | |
repository | https://github.com/mdrokz/auto_generate_cdp |
max_upload_size | |
id | 391104 |
size | 1,223,064 |
An experimental crate to generate the Chrome Devtools Protocol.
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
}
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