pub struct Validator { /* private fields */ }Expand description
The CRUDUI validator over a composed spec.
Implementations§
Source§impl Validator
impl Validator
Sourcepub fn new(properties: Map<String, Value>) -> Result<Self, ValidateError>
pub fn new(properties: Map<String, Value>) -> Result<Self, ValidateError>
Build from a composed root group’s properties map, checking every
declared rule parameter. A parameter outside the validation-rule
definitions returns a load failure located at the field’s declaration path.
Sourcepub fn validate(&self, data: &Value) -> Result<ValidationResult, ValidateError>
pub fn validate(&self, data: &Value) -> Result<ValidationResult, ValidateError>
Validate data against the composed CRUDUI spec. Root, group and repeated
data with the wrong shape return an input failure, and a parameter selected
by a condition that is outside the definitions returns a load failure;
neither produces a result.
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