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 the user 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 user matched one of the flag’s rules.
PrerequisiteFailed
Fields
prerequisite_key: String
The key of the prerequisite flag that failed.
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 user 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.
Implementations
This method determines whether or not the provided Reason is considered to be part of an ongoing experiment.
Trait Implementations
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Reason
impl UnwindSafe for Reason
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more