SuggestionEngine

Struct SuggestionEngine 

Source
pub struct SuggestionEngine { /* private fields */ }
Available on crate feature doc-audit only.
Expand description

Engine for generating automated fix suggestions.

Implementations§

Source§

impl SuggestionEngine

Source

pub fn new( crate_registry: HashMap<String, CrateInfo>, workspace_version: String, ) -> SuggestionEngine

Creates a new suggestion engine.

§Arguments
  • crate_registry - Registry of available crates and their APIs
  • workspace_version - Current workspace version
§Returns

A new SuggestionEngine instance.

Source

pub fn new_empty() -> SuggestionEngine

Creates a new suggestion engine with empty registry (for orchestrator use).

Source

pub fn suggest_api_signature_corrections( &self, api_ref: &ApiReference, file_path: &Path, config: &SuggestionConfig, ) -> Result<Vec<Suggestion>, AuditError>

Generates API signature correction suggestions.

§Arguments
  • api_ref - The API reference that needs correction
  • file_path - Path to the file containing the reference
  • config - Configuration for suggestion generation
§Returns

A vector of suggestions for correcting the API signature.

Source

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 correction
  • crate_name - Name of the crate for this version reference
  • file_path - Path to the file containing the reference
  • config - Configuration for suggestion generation
§Returns

A vector of suggestions for correcting version inconsistencies.

Source

pub fn suggest_compilation_fixes( &self, errors: &[CompilationError], file_path: &Path, config: &SuggestionConfig, ) -> Result<Vec<Suggestion>, AuditError>

Generates compilation fix suggestions based on compilation errors.

§Arguments
  • errors - Compilation errors to generate fixes for
  • file_path - Path to the file with compilation errors
  • config - Configuration for suggestion generation
§Returns

A vector of suggestions for fixing compilation errors.

Source

pub fn generate_diff_suggestions( &self, original_content: &str, suggestions: &[Suggestion], file_path: &Path, ) -> Result<String, AuditError>

Generates diff-style update suggestions.

§Arguments
  • original_content - Original file content
  • suggestions - List of suggestions to apply
  • file_path - Path to the file
§Returns

A diff-style string showing the proposed changes.

Source

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 documented
  • workspace_path - Path to the workspace root
  • docs_path - Path to the documentation directory
  • config - Configuration for suggestion generation
§Returns

A vector of suggestions for where to document new features.

Source

pub fn suggest_structure_improvements( &self, docs_path: &Path, config: &SuggestionConfig, ) -> Result<Vec<Suggestion>, AuditError>

Suggests improvements to documentation structure.

§Arguments
  • docs_path - Path to the documentation directory
  • config - Configuration for suggestion generation
§Returns

A vector of suggestions for improving documentation structure.

Source§

impl SuggestionEngine

Source

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§

Source§

impl Debug for SuggestionEngine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more