Enum launchdarkly_server_sdk::Reason
source · pub enum Reason {
Off,
TargetMatch,
RuleMatch {
rule_index: usize,
rule_id: String,
in_experiment: bool,
},
PrerequisiteFailed {
prerequisite_key: String,
},
Fallthrough {
in_experiment: bool,
},
Error {
error: Error,
},
}
Expand description
Reason describes the reason that a flag evaluation produced a particular value.
Variants§
Off
Off indicates that the flag was off and therefore returned its configured off value.
TargetMatch
TargetMatch indicates that context key was specifically targeted for this flag.
RuleMatch
Fields
rule_index: usize
Zero-based index of the crate::FlagRule that was matched.
rule_id: String
The id property of the crate::FlagRule::id that was matched.
in_experiment: bool
This optional boolean property is true if the variation was determined by a crate::Rollout whose kind was crate::RolloutKind::Experiment and if the selected crate::WeightedVariation did not have an untracked property of true. It is false otherwise.
RuleMatch indicates that the context matched one of the flag’s rules.
PrerequisiteFailed
PrerequisiteFailed indicates that the flag was considered off because it had at least one prerequisite flag that either was off or did not return the desired variation.
Fallthrough
Fields
in_experiment: bool
This optional boolean property is true if the variation was determined by a crate::Rollout whose kind was crate::RolloutKind::Experiment and if the selected crate::WeightedVariation did not have an untracked property of true. It is false otherwise.
Fallthrough indicates that the flag was on but the context did not match any targets or rules.
Error
Fields
error: Error
An error representing the Reason::Error.
Error indicates that the flag could not be evaluated, e.g. because it does not exist or due to an unexpected error. In this case the result value will be the default value that the caller passed to the client.