Trait ion_schema::types::TypeValidator
source · [−]pub trait TypeValidator {
fn is_valid(&self, value: &IonSchemaElement, type_store: &TypeStore) -> bool;
fn validate(
&self,
value: &IonSchemaElement,
type_store: &TypeStore
) -> ValidationResult;
}Expand description
Provides validation for TypeDefinition
Required Methods
sourcefn is_valid(&self, value: &IonSchemaElement, type_store: &TypeStore) -> bool
fn is_valid(&self, value: &IonSchemaElement, type_store: &TypeStore) -> bool
If the specified value violates one or more of this type’s constraints,
returns false, otherwise true
sourcefn validate(
&self,
value: &IonSchemaElement,
type_store: &TypeStore
) -> ValidationResult
fn validate(
&self,
value: &IonSchemaElement,
type_store: &TypeStore
) -> ValidationResult
Returns Err(violation) with details as to which constraints were violated,
otherwise returns Ok(()) indicating no violations were found during the validation