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
Trait Implementations
sourceimpl Serialize for Reason
impl Serialize for Reason
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
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
impl StructuralPartialEq for Reason
Auto Trait Implementations
impl RefUnwindSafe for Reason
impl Send for Reason
impl Sync for Reason
impl Unpin for Reason
impl UnwindSafe for Reason
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more