pub struct SchemaValidator {
pub schema: Schema,
pub collect_all_errors: bool,
}Expand description
Schema validator for YAML documents
Fields§
§schema: SchemaRoot schema for validation
collect_all_errors: boolWhether to collect all errors or stop at first error
Implementations§
Source§impl SchemaValidator
impl SchemaValidator
Sourcepub fn validate(&self, value: &Value) -> ValidationResult<()>
pub fn validate(&self, value: &Value) -> ValidationResult<()>
Validate a YAML value against the schema
Sourcepub fn validate_with_report(&self, value: &Value) -> Result<()>
pub fn validate_with_report(&self, value: &Value) -> Result<()>
Validate and return a formatted error report
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SchemaValidator
impl RefUnwindSafe for SchemaValidator
impl Send for SchemaValidator
impl Sync for SchemaValidator
impl Unpin for SchemaValidator
impl UnwindSafe for SchemaValidator
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