| Crates.io | pdl |
| lib.rs | pdl |
| version | 0.1.1 |
| created_at | 2019-08-02 09:57:45.199476+00 |
| updated_at | 2019-08-12 09:30:30.484093+00 |
| description | Parse PDL file for the Chrome DevTools Protocol |
| homepage | https://github.com/flier/rust-pdl |
| repository | https://github.com/flier/rust-pdl |
| max_upload_size | |
| id | 153729 |
| size | 61,218 |
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.
To use pdl in your project, add the following to your Cargo.toml:
[dependencies]
pdl = "0.1"
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