iab_gpp 0.1.2

IAB GPP Consent String implementation
Documentation
# iabgpp-rs

[![Build](https://github.com/noirotm/iabgpp-rs/actions/workflows/rust.yml/badge.svg)](https://github.com/noirotm/iabgpp-rs/actions/workflows/rust.yml)
[![docs.rs](https://img.shields.io/docsrs/iab_gpp)](https://docs.rs/iab_gpp/latest/iab_gpp/)
[![Latest Version](https://img.shields.io/crates/v/iab_gpp.svg)](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: {:?}", &section);
    }
}
```

## 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

| Section                      | Reading | Writing |
|------------------------------|:-------:|:-------:|
| 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