pub struct ValidationContext { /* private fields */ }
Expand description
Validation context for tracking errors during validation
Implementations§
Source§impl ValidationContext
impl ValidationContext
Sourcepub fn add_error(&mut self, field: String, message: String)
pub fn add_error(&mut self, field: String, message: String)
Add an error to the validation context
Sourcepub fn add_error_with_values(
&mut self,
field: String,
message: String,
expected: Value,
actual: Value,
)
pub fn add_error_with_values( &mut self, field: String, message: String, expected: Value, actual: Value, )
Add an error with expected and actual values
Sourcepub fn add_warning(&mut self, field: String, message: String)
pub fn add_warning(&mut self, field: String, message: String)
Add a warning to the validation context
Sourcepub fn result(&self) -> ValidationResult
pub fn result(&self) -> ValidationResult
Get the validation result
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Check if validation has errors
Sourcepub fn has_warnings(&self) -> bool
pub fn has_warnings(&self) -> bool
Check if validation has warnings
Trait Implementations§
Source§impl Debug for ValidationContext
impl Debug for ValidationContext
Source§impl Default for ValidationContext
impl Default for ValidationContext
Source§fn default() -> ValidationContext
fn default() -> ValidationContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ValidationContext
impl RefUnwindSafe for ValidationContext
impl Send for ValidationContext
impl Sync for ValidationContext
impl Unpin for ValidationContext
impl UnwindSafe for ValidationContext
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