pub struct CodeAnalyzer { /* private fields */ }Available on crate feature
doc-audit only.Expand description
Code analyzer for extracting API information from Rust workspace.
Implementations§
Source§impl CodeAnalyzer
impl CodeAnalyzer
Sourcepub fn new(workspace_path: PathBuf) -> CodeAnalyzer
pub fn new(workspace_path: PathBuf) -> CodeAnalyzer
Create a new code analyzer for the given workspace.
Sourcepub async fn analyze_workspace(&mut self) -> Result<&CrateRegistry, AuditError>
pub async fn analyze_workspace(&mut self) -> Result<&CrateRegistry, AuditError>
Analyze the entire workspace and build a registry of all crates and their APIs.
Sourcepub async fn get_registry(&mut self) -> Result<&CrateRegistry, AuditError>
pub async fn get_registry(&mut self) -> Result<&CrateRegistry, AuditError>
Get the cached crate registry, analyzing the workspace if not already done.
Sourcepub async fn validate_api_reference(
&mut self,
api_ref: &ApiReference,
) -> Result<ValidationResult, AuditError>
pub async fn validate_api_reference( &mut self, api_ref: &ApiReference, ) -> Result<ValidationResult, AuditError>
Validate an API reference against the analyzed crates.
Sourcepub async fn find_undocumented_apis(
&mut self,
documented_apis: &[ApiReference],
) -> Result<Vec<PublicApi>, AuditError>
pub async fn find_undocumented_apis( &mut self, documented_apis: &[ApiReference], ) -> Result<Vec<PublicApi>, AuditError>
Find APIs that exist in the codebase but are not documented.
Sourcepub async fn validate_function_signature(
&mut self,
api_ref: &ApiReference,
expected_signature: &str,
) -> Result<ValidationResult, AuditError>
pub async fn validate_function_signature( &mut self, api_ref: &ApiReference, expected_signature: &str, ) -> Result<ValidationResult, AuditError>
Validate that a function signature matches the documented signature.
Sourcepub async fn validate_struct_fields(
&mut self,
api_ref: &ApiReference,
expected_fields: &[String],
) -> Result<ValidationResult, AuditError>
pub async fn validate_struct_fields( &mut self, api_ref: &ApiReference, expected_fields: &[String], ) -> Result<ValidationResult, AuditError>
Validate that struct fields mentioned in documentation exist.
Sourcepub async fn validate_import_statement(
&mut self,
import_path: &str,
) -> Result<ValidationResult, AuditError>
pub async fn validate_import_statement( &mut self, import_path: &str, ) -> Result<ValidationResult, AuditError>
Validate that import statements are valid for the current crate structure.
Sourcepub async fn validate_method_exists(
&mut self,
type_ref: &ApiReference,
method_name: &str,
) -> Result<ValidationResult, AuditError>
pub async fn validate_method_exists( &mut self, type_ref: &ApiReference, method_name: &str, ) -> Result<ValidationResult, AuditError>
Validate that method names mentioned in documentation exist on the specified type.
Auto Trait Implementations§
impl Freeze for CodeAnalyzer
impl RefUnwindSafe for CodeAnalyzer
impl Send for CodeAnalyzer
impl Sync for CodeAnalyzer
impl Unpin for CodeAnalyzer
impl UnwindSafe for CodeAnalyzer
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