| Crates.io | iab_gpp_derive |
| lib.rs | iab_gpp_derive |
| version | 0.1.0 |
| created_at | 2025-09-28 11:12:17.971038+00 |
| updated_at | 2025-09-28 11:12:17.971038+00 |
| description | Macros for the IAB GPP Consent String implementation |
| homepage | https://github.com/noirotm/iabgpp-rs |
| repository | https://github.com/noirotm/iabgpp-rs |
| max_upload_size | |
| id | 1858244 |
| size | 38,546 |
Rust implementation of the IAB Global Privacy Platform (GPP) consent string specification.
Cargo.toml:
[dependencies]
iab-gpp = "0.1"
main.rs:
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);
}
}