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
RuleMatch indicates that the context matched one of the flag’s rules.
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.
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
Fallthrough indicates that the flag was on but the context did not match any targets or rules.
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.
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.
Fields
error: Error
An error representing the Reason::Error.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Reason
Auto Trait Implementations§
impl Freeze for Reason
impl RefUnwindSafe for Reason
impl Send for Reason
impl Sync for Reason
impl Unpin for Reason
impl UnwindSafe for Reason
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)