pub struct VersionValidator { /* private fields */ }doc-audit only.Expand description
Version validator that checks consistency between documentation and workspace.
Implementations§
Source§impl VersionValidator
impl VersionValidator
Sourcepub async fn new(workspace_path: &Path) -> Result<VersionValidator, AuditError>
pub async fn new(workspace_path: &Path) -> Result<VersionValidator, AuditError>
Sourcepub fn with_workspace_info(
workspace_info: WorkspaceVersionInfo,
) -> Result<VersionValidator, AuditError>
pub fn with_workspace_info( workspace_info: WorkspaceVersionInfo, ) -> Result<VersionValidator, AuditError>
Creates a version validator with custom workspace information.
This is useful for testing or when workspace information is already available.
Sourcepub fn validate_version_reference(
&self,
version_ref: &VersionReference,
config: &VersionValidationConfig,
) -> Result<VersionValidationResult, AuditError>
pub fn validate_version_reference( &self, version_ref: &VersionReference, config: &VersionValidationConfig, ) -> Result<VersionValidationResult, AuditError>
Sourcepub fn validate_version_references(
&self,
version_refs: &[VersionReference],
config: &VersionValidationConfig,
) -> Result<Vec<VersionValidationResult>, AuditError>
pub fn validate_version_references( &self, version_refs: &[VersionReference], config: &VersionValidationConfig, ) -> Result<Vec<VersionValidationResult>, AuditError>
Sourcepub fn validate_dependency_compatibility(
&self,
dependency_name: &str,
documented_version: &str,
config: &VersionValidationConfig,
) -> Result<VersionValidationResult, AuditError>
pub fn validate_dependency_compatibility( &self, dependency_name: &str, documented_version: &str, config: &VersionValidationConfig, ) -> Result<VersionValidationResult, AuditError>
Validates dependency version compatibility across the workspace.
This method checks that all dependency versions used in documentation are compatible with the versions actually used in the workspace.
Sourcepub fn is_version_compatible(
&self,
version1: &str,
version2: &str,
tolerance: &VersionTolerance,
) -> Result<bool, AuditError>
pub fn is_version_compatible( &self, version1: &str, version2: &str, tolerance: &VersionTolerance, ) -> Result<bool, AuditError>
Checks if a version string represents a compatible version.
This method uses semantic versioning rules to determine compatibility.
Sourcepub fn validate_crate_exists(&self, crate_name: &str) -> VersionValidationResult
pub fn validate_crate_exists(&self, crate_name: &str) -> VersionValidationResult
Sourcepub fn validate_feature_flag(
&self,
crate_name: &str,
feature_name: &str,
) -> VersionValidationResult
pub fn validate_feature_flag( &self, crate_name: &str, feature_name: &str, ) -> VersionValidationResult
Sourcepub fn validate_crate_names(
&self,
crate_names: &[String],
) -> Vec<VersionValidationResult>
pub fn validate_crate_names( &self, crate_names: &[String], ) -> Vec<VersionValidationResult>
Sourcepub fn validate_feature_mentions(
&self,
feature_mentions: &[FeatureMention],
) -> Vec<VersionValidationResult>
pub fn validate_feature_mentions( &self, feature_mentions: &[FeatureMention], ) -> Vec<VersionValidationResult>
Validates feature flag references from documentation.
This method processes feature mentions extracted from documentation and validates them against the workspace feature definitions.
Sourcepub fn validate_feature_in_any_crate(
&self,
feature_name: &str,
) -> VersionValidationResult
pub fn validate_feature_in_any_crate( &self, feature_name: &str, ) -> VersionValidationResult
Validates that a feature exists in any workspace crate.
This is used when the crate name cannot be determined from context.
Sourcepub fn get_workspace_crates(&self) -> Vec<String>
pub fn get_workspace_crates(&self) -> Vec<String>
Gets all crate names in the workspace.
Sourcepub fn get_crate_features(&self, crate_name: &str) -> Option<Vec<String>>
pub fn get_crate_features(&self, crate_name: &str) -> Option<Vec<String>>
Gets all features defined in a specific crate.
Sourcepub fn get_all_workspace_features(&self) -> HashMap<String, Vec<String>>
pub fn get_all_workspace_features(&self) -> HashMap<String, Vec<String>>
Gets all features defined across the workspace.
Sourcepub fn suggest_correct_version(
&self,
version_ref: &VersionReference,
) -> Option<String>
pub fn suggest_correct_version( &self, version_ref: &VersionReference, ) -> Option<String>
Suggests the correct version for an invalid reference.
This method provides intelligent suggestions based on the type of version reference and available workspace information.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VersionValidator
impl RefUnwindSafe for VersionValidator
impl Send for VersionValidator
impl Sync for VersionValidator
impl Unpin for VersionValidator
impl UnwindSafe for VersionValidator
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
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>
T in a tonic::Request