pub struct BatchCandidateGenerator { /* private fields */ }Expand description
Batch candidate generator that combines multiple indexing strategies.
For best recall, combines:
ComponentIndex(ecosystem, prefix, trigram-based)- LSH index (for large SBOMs, catches approximate matches)
- Cross-ecosystem mappings (optional)
The candidates from each source are deduplicated and merged.
Implementations§
Source§impl BatchCandidateGenerator
impl BatchCandidateGenerator
Sourcepub fn build(sbom: &NormalizedSbom, config: BatchCandidateConfig) -> Self
pub fn build(sbom: &NormalizedSbom, config: BatchCandidateConfig) -> Self
Create a new batch candidate generator from an SBOM.
Sourcepub fn find_candidates(
&self,
source_id: &CanonicalId,
source_component: &Component,
) -> BatchCandidateResult
pub fn find_candidates( &self, source_id: &CanonicalId, source_component: &Component, ) -> BatchCandidateResult
Generate candidates for a single component.
Sourcepub fn find_candidates_batch(
&self,
sources: &[(&CanonicalId, &Component)],
) -> Vec<BatchCandidateResult>
pub fn find_candidates_batch( &self, sources: &[(&CanonicalId, &Component)], ) -> Vec<BatchCandidateResult>
Generate candidates for multiple components in parallel.
Sourcepub fn all_candidates(
&self,
source_id: &CanonicalId,
source_component: &Component,
) -> Vec<CanonicalId>
pub fn all_candidates( &self, source_id: &CanonicalId, source_component: &Component, ) -> Vec<CanonicalId>
Get all unique candidates (deduplicated across all strategies).
Sourcepub const fn component_index(&self) -> &ComponentIndex
pub const fn component_index(&self) -> &ComponentIndex
Get the underlying component index.
Sourcepub const fn has_cross_ecosystem(&self) -> bool
pub const fn has_cross_ecosystem(&self) -> bool
Check if cross-ecosystem matching is enabled.
Sourcepub fn stats(&self) -> BatchCandidateStats
pub fn stats(&self) -> BatchCandidateStats
Get statistics about the generator.
Auto Trait Implementations§
impl Freeze for BatchCandidateGenerator
impl RefUnwindSafe for BatchCandidateGenerator
impl Send for BatchCandidateGenerator
impl Sync for BatchCandidateGenerator
impl Unpin for BatchCandidateGenerator
impl UnsafeUnpin for BatchCandidateGenerator
impl UnwindSafe for BatchCandidateGenerator
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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