[][src]Crate lib_tcstring

TCF String library which (currently only) decodes a given TCString

NOTE: This is not an official IAB library

General usage

This code runs with edition 2018
use std::convert::TryFrom;
// will return an Result which contains an TCModel V2
let tc_model_v2 = lib_tcstring::TCModel::try_from("COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA");
// will return an Result which contains an TCModel V1
let tc_model_v1 = lib_tcstring::TCModel::try_from("BOEFEAyOEFEAyAHABDENAI4AAAB9vABAASA");

If it's possible to know which TCModel version is used write it like this:

This code runs with edition 2018
use std::convert::TryFrom;
let tc_model_v2 = lib_tcstring::TCModelV2::try_from("COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA");
let tc_model_v1 = lib_tcstring::TCModelV1::try_from("BOEFEAyOEFEAyAHABDENAI4AAAB9vABAASA");

Structs

PublisherRestriction

Publisher restriction which overrides the specificed purpose

TCModelV1

TCModelV1 contains all relevant fields specified in the Vendor Consent String Format V1 except for the Version field which is omitted

TCModelV2

TCModelV2 contains all relevant fields specified in the Vendor Consent String Format V2 except for the Version field which is omitted

VendorSet

VendorSet contains a list of vendors which are either allowed or blocked based on the is_blocklist field

Enums

PublisherRestrictionType

Contains restriction types as defined in Vendor Consent String Format V2 Core String

TCModel

TCModel serves as a convenience wrapper to parse a given TCString without checking the version on the calling side

TcsError

Errors that can occur while decoding the TCString