pub struct EvaluationContext<'a> {
pub cohorts: &'a HashMap<String, CohortDefinition>,
pub flags: &'a HashMap<String, FeatureFlag>,
pub distinct_id: &'a str,
pub groups: &'a HashMap<String, String>,
pub group_properties: &'a HashMap<String, HashMap<String, Value>>,
pub group_type_mapping: &'a HashMap<String, String>,
}Expand description
Context for evaluating properties that may depend on cohorts or other flags.
groups, group_properties, and group_type_mapping are used to resolve
group-targeted and mixed-targeting flags. A group condition (one whose
aggregation_group_type_index is set, either at the flag or condition level)
is bucketed on the group key and matched against group properties looked up
via the group type mapping.
Fields§
§cohorts: &'a HashMap<String, CohortDefinition>Cohort definitions available to local evaluation, keyed by cohort ID.
flags: &'a HashMap<String, FeatureFlag>Feature flag definitions available to evaluate flag dependencies, keyed by flag key.
distinct_id: &'a strDistinct ID used for person-targeted flag bucketing.
groups: &'a HashMap<String, String>Group keys for group-targeted flags, keyed by group type.
group_properties: &'a HashMap<String, HashMap<String, Value>>Group properties for group-targeted flags, keyed by group type and then property name.
group_type_mapping: &'a HashMap<String, String>Mapping from PostHog group type index to group type name.