pub struct TcModelV2 {
Show 24 fields pub created_at: u64, pub updated_at: u64, pub cmp_id: u16, pub cmp_version: u16, pub consent_screen: u8, pub consent_language: String, pub vendor_list_version: u16, pub tcf_policy_version: u16, pub is_service_specific: bool, pub use_non_standard_stacks: bool, pub special_feature_opt_ins: Vec<u8>, pub purposes_consent: Vec<u8>, pub purposes_li_transparency: Vec<u8>, pub purpose_one_treatment: bool, pub publisher_country_code: String, pub vendors_consent: Vec<u16>, pub vendors_li_consent: Vec<u16>, pub publisher_restrictions: Vec<PublisherRestriction>, pub disclosed_vendors: Vec<u16>, pub allowed_vendors: Vec<u16>, pub publisher_purposes_consent: Vec<u8>, pub publisher_purposes_li_transparency: Vec<u8>, pub custom_purposes_consent: Vec<u8>, pub custom_purposes_li_transparency: Vec<u8>,
}
Expand description

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

Note that the “Core String”, “Disclosed Vendors”, “Allowed Vendors” and “Publisher TC” segments are mapped into fields

“Core String” field mapping

“Disclosed Vendors” segment is mapped by the disclosed_vendors field

“Allowed Vendors” segment is mapped by the allowed_vendors field

“Publisher TC” field mapping

use std::convert::TryFrom;
// will return a Result which contains either the TcModel or an Error
// if the TCString could not be parsed or the TCString includes an unsupported version
let tc_model = lib_tcstring::TcModelV2::try_from("COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA");

Fields

created_at: u64

Epoch milliseconds when this TC String was first created

updated_at: u64

Epoch milliseconds when TC String was last updated

cmp_id: u16

Consent Management Platform ID that last updated the TC String

cmp_version: u16

Consent Management Platform version of the CMP that last updated this TC String

consent_screen: u8

CMP Screen number at which consent was given for a user with the CMP that last updated this TC String

consent_language: String

ISO 639-1 language code in which the CMP UI was presented

vendor_list_version: u16

Version of the global vendor list used to create this TC String

tcf_policy_version: u16

Version of the corresponding field in the global vendor list that was used for obtaining consent

is_service_specific: bool

Whether the signals encoded in this TC String were from service-specific storage (true) or shared storage (false)

use_non_standard_stacks: bool

true means that a CMP is using customized Stack descriptions and not the standard stack descriptions defined in the Policies (Appendix A, Section E)

false means standard stacks were used

special_feature_opt_ins: Vec<u8>

List of opted-in “Special Features”

“Special Features” are numerically identified in the global vendor list separately from normal features

purposes_consent: Vec<u8>

List of allowed purposes

purposes_li_transparency: Vec<u8>

List of allowed “Legitimate Interest” purposes

purpose_one_treatment: bool

true means “Purpose 1” was not disclosed

false means “Purpose 1” was disclosed commonly as consent

publisher_country_code: Stringvendors_consent: Vec<u16>

List of allowed vendors

vendors_li_consent: Vec<u16>

List of vendors “Legitimate Interest” disclosures

publisher_restrictions: Vec<PublisherRestriction>

List of publisher restrictions on a per purpose basis

See PublisherRestriction for more details

disclosed_vendors: Vec<u16>

List of vendors that have been disclosed to a given user by a CMP

allowed_vendors: Vec<u16>

List of vendors the publisher permits to use OOB legal bases

publisher_purposes_consent: Vec<u8>

List of purposes which are established on the legal basis of consent, for the publisher

publisher_purposes_li_transparency: Vec<u8>

List of purposes which are established on the legal basis of “Legitimate Interest” and the user has not exercised their “Right to Object”

custom_purposes_consent: Vec<u8>

List of allowed custom purposes, for the publisher

custom_purposes_li_transparency: Vec<u8>

List of custom purposes which are are established on the legal basis of “Legitimate Interest”

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.