pub struct Candidate {
pub kind: MatchKind,
pub similarity: f64,
pub containment: f64,
pub package_count: Option<usize>,
pub shared_fingerprints: usize,
pub matched_lines: Vec<(u32, u32)>,
pub candidate_lines: Vec<(u32, u32)>,
pub function: FunctionInfo,
pub occurrences: Vec<Occurrence>,
pub occurrence_count: usize,
pub database: usize,
}Expand description
A stored function similar to a checked function.
Fields§
§kind: MatchKindHow the candidate matched.
similarity: f641.0 for exact matches; the (weighted) Jaccard similarity of fingerprint sets otherwise.
containment: f64(Weighted) share of the checked function’s fingerprints found in the candidate.
package_count: Option<usize>For exact matches, the number of packages containing the same normalized function.
Number of fingerprints the two functions share, common ones excluded.
matched_lines: Vec<(u32, u32)>Lines of the checked function covered by shared fingerprints.
candidate_lines: Vec<(u32, u32)>Lines of the candidate covered by shared fingerprints.
function: FunctionInfoThe stored function.
occurrences: Vec<Occurrence>Where the candidate appears, earliest publication first (at most max_occurrences).
occurrence_count: usizeNumber of places the stored function was found, excluded packages aside.
database: usizePosition of the database of the candidate in the detectors given to
detect_all; function.id is an id in that database.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Candidate
impl RefUnwindSafe for Candidate
impl Send for Candidate
impl Sync for Candidate
impl Unpin for Candidate
impl UnsafeUnpin for Candidate
impl UnwindSafe for Candidate
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more