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 more