iab_gpp_derive

Crates.ioiab_gpp_derive
lib.rsiab_gpp_derive
version0.1.0
created_at2025-09-28 11:12:17.971038+00
updated_at2025-09-28 11:12:17.971038+00
descriptionMacros for the IAB GPP Consent String implementation
homepagehttps://github.com/noirotm/iabgpp-rs
repositoryhttps://github.com/noirotm/iabgpp-rs
max_upload_size
id1858244
size38,546
Marc Noirot (noirotm)

documentation

https://docs.rs/iab_gpp/

README

iabgpp-rs

Rust implementation of the IAB Global Privacy Platform (GPP) consent string specification.

Features

  • Eager or lazy decoding of GPP sections
  • Owning type (GPPString)
  • Reference type (GPPStr)
  • Read support for all current GPP sections

Usage example

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: {:?}", &section);
    }
}
Commit count: 0

cargo fmt