pub struct GuardianValidator { /* private fields */ }Expand description
Main Guardian validator providing high-level validation operations
Implementations§
Source§impl GuardianValidator
impl GuardianValidator
Sourcepub fn new_with_config(config: GuardianConfig) -> GuardianResult<Self>
pub fn new_with_config(config: GuardianConfig) -> GuardianResult<Self>
Create a new validator with the given configuration
Sourcepub fn new() -> GuardianResult<Self>
pub fn new() -> GuardianResult<Self>
Create a validator with default configuration
Sourcepub fn from_config_file<P: AsRef<Path>>(path: P) -> GuardianResult<Self>
pub fn from_config_file<P: AsRef<Path>>(path: P) -> GuardianResult<Self>
Create a validator loading configuration from file
Sourcepub fn with_cache<P: AsRef<Path>>(self, cache_path: P) -> GuardianResult<Self>
pub fn with_cache<P: AsRef<Path>>(self, cache_path: P) -> GuardianResult<Self>
Enable caching with the specified cache file
Sourcepub fn with_report_formatter(self, formatter: ReportFormatter) -> Self
pub fn with_report_formatter(self, formatter: ReportFormatter) -> Self
Set custom report formatter
Sourcepub async fn validate_for_agent<P: AsRef<Path>>(
&mut self,
paths: Vec<P>,
) -> GuardianResult<ValidationReport>
pub async fn validate_for_agent<P: AsRef<Path>>( &mut self, paths: Vec<P>, ) -> GuardianResult<ValidationReport>
Validate files for agent workflows - primary API for autonomous agents
Sourcepub async fn validate_with_options<P: AsRef<Path>>(
&mut self,
paths: Vec<P>,
options: &ValidationOptions,
) -> GuardianResult<ValidationReport>
pub async fn validate_with_options<P: AsRef<Path>>( &mut self, paths: Vec<P>, options: &ValidationOptions, ) -> GuardianResult<ValidationReport>
Validate files with custom options
Sourcepub fn validate_file<P: AsRef<Path>>(
&self,
file_path: P,
) -> GuardianResult<ValidationReport>
pub fn validate_file<P: AsRef<Path>>( &self, file_path: P, ) -> GuardianResult<ValidationReport>
Validate a single file
Sourcepub fn validate_directory<P: AsRef<Path>>(
&self,
root: P,
options: &AnalysisOptions,
) -> GuardianResult<ValidationReport>
pub fn validate_directory<P: AsRef<Path>>( &self, root: P, options: &AnalysisOptions, ) -> GuardianResult<ValidationReport>
Validate entire directory tree
Sourcepub fn format_report(
&self,
report: &ValidationReport,
format: OutputFormat,
) -> GuardianResult<String>
pub fn format_report( &self, report: &ValidationReport, format: OutputFormat, ) -> GuardianResult<String>
Format a validation report for output
Sourcepub fn pattern_statistics(&self) -> PatternStats
pub fn pattern_statistics(&self) -> PatternStats
Get analyzer statistics
Sourcepub fn cache_statistics(&self) -> Option<CacheStatistics>
pub fn cache_statistics(&self) -> Option<CacheStatistics>
Get cache statistics (if caching is enabled)
Sourcepub fn clear_cache(&mut self) -> GuardianResult<()>
pub fn clear_cache(&mut self) -> GuardianResult<()>
Clear cache (if enabled)
Sourcepub fn save_cache(&mut self) -> GuardianResult<()>
pub fn save_cache(&mut self) -> GuardianResult<()>
Save cache to disk (if enabled and modified)
Sourcepub fn cleanup_cache(&mut self) -> GuardianResult<Option<usize>>
pub fn cleanup_cache(&mut self) -> GuardianResult<Option<usize>>
Cleanup cache by removing entries for non-existent files
Auto Trait Implementations§
impl Freeze for GuardianValidator
impl RefUnwindSafe for GuardianValidator
impl Send for GuardianValidator
impl Sync for GuardianValidator
impl Unpin for GuardianValidator
impl UnwindSafe for GuardianValidator
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