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