commit | 9f0d5f95b03fc73d31807fb3feea447d57a814e4 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <[email protected]> | Thu Nov 16 19:32:01 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Thu Nov 16 19:32:01 2023 +0000 |
tree | d261c5021cf1151e37b78b4c190a16037bd0575e | |
parent | 29b367bea511d5160aa6b2c369b8c726196a61d5 [diff] | |
parent | 6d93ae560502250d1d2315f9ffb775b5e6431ce5 [diff] |
Merge "Migrate to cargo_embargo." into main am: 6d93ae5605 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pdl-compiler/+/2828248 Change-Id: I3fb09258e0573031426428a4c11f80978826a4c7 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: