pub enum KeyStrategy {
Average,
All,
None,
Rubric {
scorer: Arc<dyn Fn(&str, &Value, Option<&Value>) -> f64 + Send + Sync>,
},
}Expand description
Per-key aggregation strategy for JsonMatchEvaluator.
Variants§
Average
Average per-key scores (1.0 per matching key, 0.0 otherwise).
All
Pass only when every compared key matches the expected value.
None
Pass only when none of the compared keys match (i.e. every key differs).
Rubric
Per-key rubric: keys listed here are scored by the caller-supplied closure; unlisted keys contribute a fixed default score.
Trait Implementations§
Source§impl Clone for KeyStrategy
impl Clone for KeyStrategy
Source§fn clone(&self) -> KeyStrategy
fn clone(&self) -> KeyStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for KeyStrategy
impl !RefUnwindSafe for KeyStrategy
impl Send for KeyStrategy
impl Sync for KeyStrategy
impl Unpin for KeyStrategy
impl UnsafeUnpin for KeyStrategy
impl !UnwindSafe for KeyStrategy
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