#dev-tools #chrome #headless #api-bindings

pdl

Parse PDL file for the Chrome DevTools Protocol

2 releases

0.1.1 Aug 12, 2019
0.1.0 Aug 2, 2019

#1437 in Development tools

Download history 83/week @ 2023-12-03 36/week @ 2023-12-10 21/week @ 2023-12-17 55/week @ 2023-12-31 93/week @ 2024-01-07 59/week @ 2024-01-14 24/week @ 2024-01-21 82/week @ 2024-01-28 62/week @ 2024-02-04 62/week @ 2024-02-11 50/week @ 2024-02-18 55/week @ 2024-02-25 59/week @ 2024-03-03 45/week @ 2024-03-10 62/week @ 2024-03-17

221 downloads per month

MIT license

52KB
1.5K SLoC

pdl Travis Build Status Appveyor Build status crate docs dependency status

Parse PDL file for the Chrome DevTools Protocol.

NOTE: PDL (pronounced as ˈpo͞odl) is a home-grown format to describe the DevTools protocol. PDL support, such as Sublime syntax highlighting and the json converter, is available at https://github.com/pavelfeldman/pdl.

Usage

To use pdl in your project, add the following to your Cargo.toml:

[dependencies]
pdl = "0.1"

Example

Use pdl::parse to parse a PDL file as strongly typed data structures.

let mut f = File::open("browser_protoco.pdl")?;
let mut s = String::new();
f.read_to_string(&mut s)?;

let (rest, proto) = pdl::parse(&s)?;

println!("PDL: {}", proto);
println!("JSON: {}", proto.to_json_pretty());

For more detail, please check the parser example.

$ cargo run --example parser -- browser_protocol.pdl --json --output browser_protocol.json

Resources

Dependencies

~7–485KB
~10K SLoC