Struct clean_insights_sdk::consents::Consents
source · [−]pub struct Consents {
pub features: HashMap<Feature, Consent>,
pub campaigns: HashMap<String, Consent>,
}
Expand description
This struct keeps track of all granted or denied consents of a user.
There are two different types of consents:
- Consents for common features like if we’re allowed to evaluate the locale or a user agent.
- Consents per measurement campaign.
The time of the consent is recorded along with it’s state: If it was actually granted or denied.
Consents for common features are given indefinitely, since they are only ever recorded along with running campaigns.
Consents for campaigns only last for a certain amount of days.
Fields
features: HashMap<Feature, Consent>
campaigns: HashMap<String, Consent>
Implementations
User consents to evaluate a Feature
.
User denies consent to evaluate a Feature
.
Returns if consent to a Feature
was given.
User consents to run a specific campaign.
Arguments
- campaign_id: The campaign ID.
- campaign: The campaign.
User denies consent to run a specific campaign.
Returns if consent to run a campaign was given and is valid for the given period.
Returns if consent to run a campaign was given and is now valid.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more