Skip to main content

match_reference_values_with_profile

Function match_reference_values_with_profile 

Source
pub fn match_reference_values_with_profile<P: ?Sized + Profile>(
    ref_triples: &[ReferenceTriple],
    evidence: &[EvidenceClaim],
    profile: Option<&P>,
    ctx: &MatchContext,
) -> Vec<CorroboratedClaim>
Expand description

Like match_reference_values but consults a profile’s Profile::match_measurement hook for each candidate (reference, evidence) measurement pair before falling back to the crate’s default exact-match logic.

Per-pair semantics:

  • Some(true) from the profile — the pair is treated as matching even if core fields would disagree.
  • Some(false) from the profile — the pair is treated as not matching even if core fields would agree.
  • None from the profile — defer to the default per-pair logic (the same comparison performed by match_reference_values).

The profile is consulted independently for each (reference, evidence) pair within a triple. Pass None for profile to get behavior identical to match_reference_values.

Profile lookup is the caller’s responsibility:

let profile = registry.get(corim.profile.as_ref()?);
let ctx = MatchContext::system_now();
let claims = match_reference_values_with_profile(&triples, &evidence, profile, &ctx);

The P: ?Sized + Profile bound lets callers pass any of: &dyn Profile, &(dyn Profile + Send + Sync) (e.g. from crate::profile::ProfileRegistry::get), or &SomeConcreteProfile. When passing None, the type must be annotated: None::<&dyn Profile>.