pub enum Confidence {
Identified,
Matched(u8),
}Expand description
How the record was attached to the entity it describes.
Kept because the roadmap’s rule for M1 is that a file matched to a release approximately is never treated as certain. A value reached by asking for a known identifier and a value reached by guessing from a name are different claims, and a layer that stored them identically could not offer the review that makes an approximate match acceptable in the first place.
Variants§
Identified
The source was asked about this exact thing, by identifier.
Matched(u8)
Reached by matching names and metadata, scored from 0 to 100.
Implementations§
Source§impl Confidence
impl Confidence
Sourcepub fn matched(score: u8) -> Confidence
pub fn matched(score: u8) -> Confidence
A matched confidence, with the score bounded to 0–100.
Bounded here rather than trusted from the caller: a score above 100 would print as one and sort above a certainty, which is exactly the confusion this type exists to prevent.
Sourcepub fn is_certain(self) -> bool
pub fn is_certain(self) -> bool
true when the record was reached by identifier rather than by guess.
Trait Implementations§
Source§impl Clone for Confidence
impl Clone for Confidence
Source§fn clone(&self) -> Confidence
fn clone(&self) -> Confidence
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more