https://github.com/flier/rust-pdl
Parse PDL file for the Chrome DevTools Protocol
https://github.com/flier/rust-pdl
Last synced: over 1 year ago
JSON representation
Parse PDL file for the Chrome DevTools Protocol
- Host: GitHub
- URL: https://github.com/flier/rust-pdl
- Owner: flier
- Created: 2019-07-31T11:15:35.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-12T09:46:17.000Z (almost 7 years ago)
- Last Synced: 2025-03-18T21:50:47.509Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 44.9 KB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pdl [](https://travis-ci.org/flier/rust-pdl) [](https://ci.appveyor.com/project/flier/rust-pdl) [](https://crates.io/crates/pdl) [](https://docs.rs/crate/pdl/) [](https://deps.rs/repo/github/flier/rust-pdl)
Parse PDL file for [the Chrome DevTools Protocol](https://github.com/ChromeDevTools/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:
```toml
[dependencies]
pdl = "0.1"
```
## Example
Use `pdl::parse` to parse a PDL file as strongly typed data structures.
```rust
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.
```sh
$ cargo run --example parser -- browser_protocol.pdl --json --output browser_protocol.json
```
## Resources
- [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) - Chrome DevTools Protocol Domain documentation
- [Awesome chrome-devtools](https://github.com/ChromeDevTools/awesome-chrome-devtools) - Awesome tooling and resources in the Chrome DevTools ecosystem
- [devtools-protocol repo](https://github.com/ChromeDevTools/devtools-protocol) - File issues at this repo if you have concerns or problems with the DevTools Protocol (aka Chrome Remote Debugging Protocol).