iab_gpp

Crates.ioiab_gpp
lib.rsiab_gpp
version0.1.2
created_at2025-09-28 11:13:00.195906+00
updated_at2025-12-15 00:14:57.01792+00
descriptionIAB GPP Consent String implementation
homepagehttps://github.com/noirotm/iabgpp-rs
repositoryhttps://github.com/noirotm/iabgpp-rs
max_upload_size
id1858247
size214,503
Marc Noirot (noirotm)

documentation

https://docs.rs/iab_gpp/

README

iab_gpp

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

Features

  • Eager or lazy decoding of GPP sections
  • Owning type (GPPString)
  • 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