commit | 9f5e15c2ac3ccd1c2aab6969ab61fde57be3ef97 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | Thu Nov 16 19:30:27 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Nov 16 19:30:27 2023 +0000 |
tree | d261c5021cf1151e37b78b4c190a16037bd0575e | |
parent | 1758121abcb7332cad2d0d99ae6b5854d07e95e6 [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: Ia56b5c60b186d487ea4eb37e38a5a6ffbb62c169 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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: