pub struct SuggestionEngine { /* private fields */ }Available on crate feature
doc-audit only.Expand description
Engine for generating automated fix suggestions.
Implementations§
Source§impl SuggestionEngine
impl SuggestionEngine
Sourcepub fn new(
crate_registry: HashMap<String, CrateInfo>,
workspace_version: String,
) -> SuggestionEngine
pub fn new( crate_registry: HashMap<String, CrateInfo>, workspace_version: String, ) -> SuggestionEngine
Sourcepub fn new_empty() -> SuggestionEngine
pub fn new_empty() -> SuggestionEngine
Creates a new suggestion engine with empty registry (for orchestrator use).
Sourcepub fn suggest_api_signature_corrections(
&self,
api_ref: &ApiReference,
file_path: &Path,
config: &SuggestionConfig,
) -> Result<Vec<Suggestion>, AuditError>
pub fn suggest_api_signature_corrections( &self, api_ref: &ApiReference, file_path: &Path, config: &SuggestionConfig, ) -> Result<Vec<Suggestion>, AuditError>
Sourcepub fn suggest_version_corrections(
&self,
version_ref: &VersionReference,
crate_name: &str,
file_path: &Path,
config: &SuggestionConfig,
) -> Result<Vec<Suggestion>, AuditError>
pub fn suggest_version_corrections( &self, version_ref: &VersionReference, crate_name: &str, file_path: &Path, config: &SuggestionConfig, ) -> Result<Vec<Suggestion>, AuditError>
Generates version consistency correction suggestions.
§Arguments
version_ref- The version reference that needs correctioncrate_name- Name of the crate for this version referencefile_path- Path to the file containing the referenceconfig- Configuration for suggestion generation
§Returns
A vector of suggestions for correcting version inconsistencies.
Sourcepub fn suggest_compilation_fixes(
&self,
errors: &[CompilationError],
file_path: &Path,
config: &SuggestionConfig,
) -> Result<Vec<Suggestion>, AuditError>
pub fn suggest_compilation_fixes( &self, errors: &[CompilationError], file_path: &Path, config: &SuggestionConfig, ) -> Result<Vec<Suggestion>, AuditError>
Sourcepub fn generate_diff_suggestions(
&self,
original_content: &str,
suggestions: &[Suggestion],
file_path: &Path,
) -> Result<String, AuditError>
pub fn generate_diff_suggestions( &self, original_content: &str, suggestions: &[Suggestion], file_path: &Path, ) -> Result<String, AuditError>
Sourcepub fn suggest_documentation_placement(
&self,
undocumented_apis: &[PublicApi],
workspace_path: &Path,
docs_path: &Path,
config: &SuggestionConfig,
) -> Result<Vec<Suggestion>, AuditError>
pub fn suggest_documentation_placement( &self, undocumented_apis: &[PublicApi], workspace_path: &Path, docs_path: &Path, config: &SuggestionConfig, ) -> Result<Vec<Suggestion>, AuditError>
Generates documentation placement suggestions for new features.
§Arguments
undocumented_apis- APIs that are not documentedworkspace_path- Path to the workspace rootdocs_path- Path to the documentation directoryconfig- Configuration for suggestion generation
§Returns
A vector of suggestions for where to document new features.
Sourcepub fn suggest_structure_improvements(
&self,
docs_path: &Path,
config: &SuggestionConfig,
) -> Result<Vec<Suggestion>, AuditError>
pub fn suggest_structure_improvements( &self, docs_path: &Path, config: &SuggestionConfig, ) -> Result<Vec<Suggestion>, AuditError>
Source§impl SuggestionEngine
impl SuggestionEngine
Sourcepub async fn generate_suggestions_for_category(
&self,
category: IssueCategory,
issues: &[&AuditIssue],
_crate_registry: &CrateRegistry,
) -> Result<Vec<Recommendation>, AuditError>
pub async fn generate_suggestions_for_category( &self, category: IssueCategory, issues: &[&AuditIssue], _crate_registry: &CrateRegistry, ) -> Result<Vec<Recommendation>, AuditError>
Generate suggestions for a specific category of issues.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SuggestionEngine
impl RefUnwindSafe for SuggestionEngine
impl Send for SuggestionEngine
impl Sync for SuggestionEngine
impl Unpin for SuggestionEngine
impl UnwindSafe for SuggestionEngine
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request