pub struct Provenance {
pub sources: SmallVec<[Source; 2]>,
pub confidence: Option<f32>,
}Expand description
Which extraction source(s) contributed to an item, in contribution order, plus a confidence score set only by heuristic tiers.
Fields§
§sources: SmallVec<[Source; 2]>Contributing sources, ordered by contribution (earliest first).
confidence: Option<f32>Set only when a heuristic tier (e.g. Tier B help-text) produced this
item; None for structured/authoritative sources.
Implementations§
Source§impl Provenance
impl Provenance
Sourcepub fn single(source: Source) -> Provenance
pub fn single(source: Source) -> Provenance
A Provenance crediting a single source, with no confidence score.
Sourcepub fn with_confidence(source: Source, confidence: f32) -> Provenance
pub fn with_confidence(source: Source, confidence: f32) -> Provenance
A Provenance crediting a single heuristic source with a confidence
score.
The highest authority on axis among this item’s contributing
sources. 0 if there are no contributing sources.
Sourcepub fn absorb(&mut self, other: &Provenance)
pub fn absorb(&mut self, other: &Provenance)
Merge another Provenance into this one: union the source lists
(deduplicated, order preserved) and combine confidence
conservatively (the lower of the two, since overall trust is bounded
by the least-confident contributor).
Trait Implementations§
Source§impl Clone for Provenance
impl Clone for Provenance
Source§fn clone(&self) -> Provenance
fn clone(&self) -> Provenance
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more