statsig_rust/gcir/
gcir_options.rs

1use serde::Deserialize;
2use std::collections::HashSet;
3
4use crate::{GCIRResponseFormat, HashAlgorithm};
5
6#[derive(Default, Deserialize)]
7pub struct ClientInitResponseOptions {
8    pub hash_algorithm: Option<HashAlgorithm>,
9    pub client_sdk_key: Option<String>,
10    pub include_local_overrides: Option<bool>,
11    pub feature_gate_filter: Option<HashSet<String>>,
12    pub experiment_filter: Option<HashSet<String>>,
13    pub dynamic_config_filter: Option<HashSet<String>>,
14    pub layer_filter: Option<HashSet<String>>,
15    pub param_store_filter: Option<HashSet<String>>,
16    pub response_format: Option<GCIRResponseFormat>,
17    pub remove_id_type: Option<bool>,
18}
19
20impl ClientInitResponseOptions {
21    pub(crate) fn get_hash_algorithm(&self) -> &HashAlgorithm {
22        self.hash_algorithm.as_ref().unwrap_or(&HashAlgorithm::Djb2)
23    }
24}