pub struct GeckoPrefStore {
pub handler: Arc<Box<dyn GeckoPrefHandler>>,
pub state: Mutex<GeckoPrefStoreState>,
}
Fields§
§handler: Arc<Box<dyn GeckoPrefHandler>>
§state: Mutex<GeckoPrefStoreState>
Implementations§
Source§impl GeckoPrefStore
impl GeckoPrefStore
pub fn new(handler: Arc<Box<dyn GeckoPrefHandler>>) -> Self
pub fn initialize(&self) -> Result<()>
pub fn get_mutable_pref_state(&self) -> MutexGuard<'_, GeckoPrefStoreState>
pub fn pref_is_user_set(&self, pref: &str) -> bool
Sourcepub fn map_gecko_prefs_to_enrollment_slugs_and_update_store(
&self,
experiments: &[Experiment],
enrollments: &[ExperimentEnrollment],
experiments_by_slug: &HashMap<String, EnrolledExperiment>,
) -> HashMap<String, HashSet<String>>
pub fn map_gecko_prefs_to_enrollment_slugs_and_update_store( &self, experiments: &[Experiment], enrollments: &[ExperimentEnrollment], experiments_by_slug: &HashMap<String, EnrolledExperiment>, ) -> HashMap<String, HashSet<String>>
This method accomplishes a number of tasks important to the Gecko pref enrollment workflow.
- It returns a map of pref string to a vector of enrolled recipes in which the value for the enrolled branch’s feature values includes the property of that feature that sets the aforementioned pref.
- It updates the GeckoPrefStore state, such that the appropriate GeckoPrefState’s
enrollment_value
reflects the appropriate value.
Auto Trait Implementations§
impl !Freeze for GeckoPrefStore
impl !RefUnwindSafe for GeckoPrefStore
impl Send for GeckoPrefStore
impl Sync for GeckoPrefStore
impl Unpin for GeckoPrefStore
impl !UnwindSafe for GeckoPrefStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Read more