pub struct SamplingEvaluator { /* private fields */ }Expand description
State machine for dynamic sampling.
Implementations§
Source§impl SamplingEvaluator
impl SamplingEvaluator
Sourcepub fn match_rules<'a, I, G>(
self,
seed: Uuid,
instance: &G,
rules: I,
) -> ControlFlow<SamplingMatch, Self>
pub fn match_rules<'a, I, G>( self, seed: Uuid, instance: &G, rules: I, ) -> ControlFlow<SamplingMatch, Self>
Attempts to find a match for sampling rules using ControlFlow.
This function returns a ControlFlow to provide control over the matching process.
-
ControlFlow::Continue: Indicates that matching is incomplete, and more rules can be evaluated.- This state occurs either if no active rules match the provided data, or if the matched rules are factors requiring a final sampling value.
- The returned evaluator contains the state of the matched rules and the accumulated sampling factor.
- If this value is returned and there are no more rules to evaluate, it should be interpreted as “no match.”
-
ControlFlow::Break: Indicates that one or more rules have successfully matched.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SamplingEvaluator
impl RefUnwindSafe for SamplingEvaluator
impl Send for SamplingEvaluator
impl Sync for SamplingEvaluator
impl Unpin for SamplingEvaluator
impl UnsafeUnpin for SamplingEvaluator
impl UnwindSafe for SamplingEvaluator
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
Mutably borrows from an owned value. Read more