nimbus::stateful::targeting

Trait RecordedContext

source
pub trait RecordedContext: Send + Sync {
    // Required methods
    fn to_json(&self) -> Map<String, Value>;
    fn get_event_queries(&self) -> HashMap<String, String>;
    fn set_event_query_values(&self, event_query_values: HashMap<String, f64>);
    fn record(&self);
}

Required Methods§

source

fn to_json(&self) -> Map<String, Value>

Returns a JSON representation of the context object

This method will be implemented in foreign code, i.e: Kotlin, Swift, Python, etc…

source

fn get_event_queries(&self) -> HashMap<String, String>

Returns a HashMap representation of the event queries that will be used in the targeting context

This method will be implemented in foreign code, i.e: Kotlin, Swift, Python, etc…

source

fn set_event_query_values(&self, event_query_values: HashMap<String, f64>)

Sets the object’s internal value for the event query values

This method will be implemented in foreign code, i.e: Kotlin, Swift, Python, etc…

source

fn record(&self)

Records the context object to Glean

This method will be implemented in foreign code, i.e: Kotlin, Swift, Python, etc…

Implementations§

source§

impl dyn RecordedContext

source

pub fn execute_queries( &self, nimbus_targeting_helper: &NimbusTargetingHelper, ) -> Result<HashMap<String, f64>>

source

pub fn validate_queries(&self) -> Result<()>

Implementors§