pub enum FlagValue {
Bool(bool),
String(String),
Int(i64),
Json(String),
}Expand description
A single flag value. Four concrete shapes cover every flag provider the plan lists (OpenFeature, Unleash, LaunchDarkly, Statsig) without making any of them special.
Json carries a JSON-encoded string rather than a serde_json::Value
so the whole enum round-trips through the WASM ABI as plain bytes. The
caller parses the string in its own code if it needs structured access.
Variants§
Bool(bool)
Boolean flag. Used for kill-switches, simple on/off rollouts.
String(String)
String flag. Used for A/B/C-style variants (“control”, “treatment”).
Int(i64)
Integer flag. Used for numeric thresholds (batch sizes, timeouts).
Json(String)
JSON-encoded structured flag. The string is always a valid JSON document; the backend guarantees this.
Implementations§
Source§impl FlagValue
impl FlagValue
Sourcepub fn as_bool(&self) -> bool
pub fn as_bool(&self) -> bool
Convenience: true if this is a Bool(true). For every other
variant, including Bool(false), returns false.