pub struct BugKnowledgeBase { /* private fields */ }Expand description
Bug knowledge base for RAG retrieval
Implementations§
Source§impl BugKnowledgeBase
impl BugKnowledgeBase
Sourcepub fn add_bug(&mut self, bug: BugDocument)
pub fn add_bug(&mut self, bug: BugDocument)
Add a bug to the knowledge base
Sourcepub fn search(&self, query: &str, top_k: usize) -> Vec<SimilarBug>
pub fn search(&self, query: &str, top_k: usize) -> Vec<SimilarBug>
Search for similar bugs using BM25
Sourcepub fn get_fix_patterns(&self, bug_ids: &[String]) -> Vec<SuggestedFix>
pub fn get_fix_patterns(&self, bug_ids: &[String]) -> Vec<SuggestedFix>
Get fix patterns for similar bugs
Sourcepub fn get_bug(&self, id: &str) -> Option<&BugDocument>
pub fn get_bug(&self, id: &str) -> Option<&BugDocument>
Get bug by ID
Sourcepub fn get_by_category(&self, category: DefectCategory) -> Vec<&BugDocument>
pub fn get_by_category(&self, category: DefectCategory) -> Vec<&BugDocument>
Get all bugs in a category
Sourcepub fn import_from_yaml(path: &Path) -> Result<Self>
pub fn import_from_yaml(path: &Path) -> Result<Self>
Import bugs from YAML file
Sourcepub fn export_to_yaml(&self, path: &Path) -> Result<()>
pub fn export_to_yaml(&self, path: &Path) -> Result<()>
Export bugs to YAML file
Trait Implementations§
Source§impl Debug for BugKnowledgeBase
impl Debug for BugKnowledgeBase
Auto Trait Implementations§
impl Freeze for BugKnowledgeBase
impl RefUnwindSafe for BugKnowledgeBase
impl Send for BugKnowledgeBase
impl Sync for BugKnowledgeBase
impl Unpin for BugKnowledgeBase
impl UnwindSafe for BugKnowledgeBase
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.