commit | e5f3986d1e740294e1dcc174b54d50e2a1fe841f | [log] [tgz] |
---|---|---|
author | Treehugger Robot <[email protected]> | Thu Nov 16 20:41:53 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Thu Nov 16 20:41:53 2023 +0000 |
tree | d261c5021cf1151e37b78b4c190a16037bd0575e | |
parent | 949c9ba599f735bb127cbc70d7f88d2cc8002dce [diff] | |
parent | fe2c5a9ad2c302383df75fcc136fd8629cfd0d9f [diff] |
Merge "Migrate to cargo_embargo." into main am: 6d93ae5605 am: 9f0d5f95b0 am: fe2c5a9ad2 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pdl-compiler/+/2828248 Change-Id: Id73b79b959033cfff132f8d90e391d5fda4128cb Signed-off-by: Automerger Merge Worker <[email protected]>
PDL is a domain specific language for writing the definition of binary protocol packets. Parsing and validating packets from raw bytes is tedious and error prone in any language. PDL generates memory safe and tailored backends for multiple target languages:
- Rust - C++ - Python
Historically PDL was developed as part of the Android Bluetooth stack (bluetooth_packetgen) as a way to generate the parser and serializer for Bluetooth packets, and reduce the number of memory safety issues that come with manipulating and validating raw data.
cargo run my-protocol.pdl --output-format rust > my-protocol.rs
Language specific instructions are provided for all supported backends: