# iabgpp-rs
[](https://github.com/noirotm/iabgpp-rs/actions/workflows/rust.yml)
[](https://docs.rs/iab_gpp/latest/iab_gpp/)
[](https://crates.io/crates/iab_gpp)
Rust implementation of the IAB Global Privacy Platform (GPP)
[consent string specification](https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/blob/main/Core/Consent%20String%20Specification.md).
โ ๏ธ This is work in progress.
## Features
- Eager or lazy decoding of GPP sections
- Owning type (GPPString)
- Read support for all current GPP sections
## Usage example
Cargo.toml:
```toml
[dependencies]
iab-gpp = "0.1"
```
main.rs:
```rust
use std::error::Error;
use std::str::FromStr;
use iab_gpp::v1::GPPString;
fn main() {
let s = "DBABM~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA";
let gpp_str = GPPString::from_str(s).expect("a valid GPP string");
for &id in gpp_str.section_ids() {
println!("Section id: {:?}", id);
let section = gpp_str.decode_section(id).expect("a valid section");
println!("Section: {:?}", §ion);
}
}
```
## GPP Standard support
This crate intends to be in sync with the GPP specification, meaning that it should
be able to read payloads with the versions specified here.
If the standard gets updated with new versions, this page should keep track of
incompatibilities.
Legend:
- โ
complete support
- โ partial support
- ๐งช experimental support
- โ no support
| GPP string v1 | โ
| โ |
| US Privacy v1 (deprecated) | โ
| โ |
| EU TCF v2.2 | โ
| โ |
| EU TCF v1 (deprecated) | โ
| โ |
| Canadian TCF v1 (deprecated) | โ
| โ |
| Canadian TCF v1.1 | โ
| โ |
| US - National v1 | โ
| โ |
| US - National v2 | ๐งช | โ |
| US - California | โ
| โ |
| US - Virginia | โ
| โ |
| US - Colorado | โ
| โ |
| US - Utah | โ
| โ |
| US - Connecticut | โ
| โ |
| US - Florida | ๐งช | โ |
| US - Montana | ๐งช | โ |
| US - Oregon | ๐งช | โ |
| US - Texas | ๐งช | โ |
| US - Delaware | ๐งช | โ |
| US - Iowa | ๐งช | โ |
| US - Nebraska | ๐งช | โ |
| US - New Hampshire | ๐งช | โ |
| US - New Jersey | ๐งช | โ |
| US - Tennessee | ๐งช | โ |
| US - Minnesota | ๐งช | โ |
## Development status
The current plan:
- complete reader implementation for version 0.1
- read + write support in version 0.2