pub struct Validator {
pub is_valid: bool,
pub errors: Vec<ValidationError>,
pub object_positions: HashMap<String, Vec<Position>>,
pub enum_positions: HashMap<String, Vec<Position>>,
}Expand description
Validator for checking the integrity of a data model.
Fields§
§is_valid: bool§errors: Vec<ValidationError>§object_positions: HashMap<String, Vec<Position>>§enum_positions: HashMap<String, Vec<Position>>Implementations§
Source§impl Validator
impl Validator
pub fn reset(&mut self)
Sourcepub fn add_error(&mut self, error: ValidationError)
pub fn add_error(&mut self, error: ValidationError)
Sourcepub fn log_result(&self)
pub fn log_result(&self)
Prints all validation errors to the log.
This method iterates over the errors vector and logs each error using the error! macro.
Trait Implementations§
Source§impl Error for Validator
impl Error for Validator
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
impl StructuralPartialEq for Validator
Auto Trait Implementations§
impl Freeze for Validator
impl RefUnwindSafe for Validator
impl Send for Validator
impl Sync for Validator
impl Unpin for Validator
impl UnsafeUnpin for Validator
impl UnwindSafe for Validator
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.