pub struct ValidationState {
pub path: EurePath,
pub has_holes: bool,
pub errors: Vec<ValidationError>,
pub warnings: Vec<ValidationWarning>,
/* private fields */
}Expand description
Internal mutable state during validation.
Wrapped in RefCell to allow interior mutability through shared references.
Fields§
§path: EurePathCurrent path in the document (for error reporting)
has_holes: boolWhether any holes have been encountered
errors: Vec<ValidationError>Accumulated validation errors
warnings: Vec<ValidationWarning>Accumulated warnings
Implementations§
Source§impl ValidationState
impl ValidationState
pub fn new() -> Self
Sourcepub fn record_error(&mut self, error: ValidationError)
pub fn record_error(&mut self, error: ValidationError)
Record an error (validation continues).
Sourcepub fn record_warning(&mut self, warning: ValidationWarning)
pub fn record_warning(&mut self, warning: ValidationWarning)
Record a warning.
Sourcepub fn mark_has_holes(&mut self)
pub fn mark_has_holes(&mut self)
Mark that a hole was encountered.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Check if any errors have been recorded.
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
Get the number of errors.
Sourcepub fn push_path_ident(&mut self, ident: Identifier)
pub fn push_path_ident(&mut self, ident: Identifier)
Push an identifier to the path.
Sourcepub fn push_path_key(&mut self, key: ObjectKey)
pub fn push_path_key(&mut self, key: ObjectKey)
Push a key to the path.
Sourcepub fn push_path_index(&mut self, index: usize)
pub fn push_path_index(&mut self, index: usize)
Push an array index to the path.
Sourcepub fn push_path_tuple_index(&mut self, index: u8)
pub fn push_path_tuple_index(&mut self, index: u8)
Push a tuple index to the path.
Sourcepub fn push_path_extension(&mut self, ident: Identifier)
pub fn push_path_extension(&mut self, ident: Identifier)
Push an extension to the path.
Sourcepub fn finish(self) -> ValidationOutput
pub fn finish(self) -> ValidationOutput
Consume and produce final output.
Sourcepub fn record_variant_errors(
&mut self,
variant_name: String,
schema_id: SchemaNodeId,
errors: Vec<ValidationError>,
)
pub fn record_variant_errors( &mut self, variant_name: String, schema_id: SchemaNodeId, errors: Vec<ValidationError>, )
Record variant attempt errors (for union validation).
Sourcepub fn take_variant_errors(
&mut self,
) -> Vec<(String, SchemaNodeId, Vec<ValidationError>)>
pub fn take_variant_errors( &mut self, ) -> Vec<(String, SchemaNodeId, Vec<ValidationError>)>
Take collected variant errors (for union error construction).
Sourcepub fn clear_variant_errors(&mut self)
pub fn clear_variant_errors(&mut self)
Clear variant errors without taking (for successful variant match).