pub struct CodeValidator { /* private fields */ }Expand description
Validates generated code before writing
Implementations§
Source§impl CodeValidator
impl CodeValidator
Sourcepub fn with_config(config: ValidationConfig) -> Self
pub fn with_config(config: ValidationConfig) -> Self
Creates a new CodeValidator with custom configuration
Sourcepub fn validate(
&self,
files: &[GeneratedFile],
) -> Result<ValidationResult, GenerationError>
pub fn validate( &self, files: &[GeneratedFile], ) -> Result<ValidationResult, GenerationError>
Sourcepub fn validate_file(
&self,
file: &GeneratedFile,
) -> Result<ValidationResult, GenerationError>
pub fn validate_file( &self, file: &GeneratedFile, ) -> Result<ValidationResult, GenerationError>
Validates a single generated file
Sourcepub fn is_valid(&self, result: &ValidationResult) -> bool
pub fn is_valid(&self, result: &ValidationResult) -> bool
Checks if validation passed
Sourcepub fn get_all_issues(&self, result: &ValidationResult) -> Vec<String>
pub fn get_all_issues(&self, result: &ValidationResult) -> Vec<String>
Gets all validation issues (errors and warnings)
Trait Implementations§
Source§impl Clone for CodeValidator
impl Clone for CodeValidator
Source§fn clone(&self) -> CodeValidator
fn clone(&self) -> CodeValidator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodeValidator
impl Debug for CodeValidator
Auto Trait Implementations§
impl Freeze for CodeValidator
impl RefUnwindSafe for CodeValidator
impl Send for CodeValidator
impl Sync for CodeValidator
impl Unpin for CodeValidator
impl UnwindSafe for CodeValidator
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