[−][src]Struct jsl::validator::Validator
Validates instances against a registry of schemas.
Methods
impl<'a> Validator<'a>
[src]
pub fn new(registry: &'a Registry) -> Self
[src]
Constructs a new validator using a registry and the default configuration.
pub fn new_with_config(config: Config, registry: &'a Registry) -> Self
[src]
Constructs a new validator using a registry and configuration.
pub fn validate(
&'a self,
instance: &'a Value
) -> Result<Vec<ValidationError<'a>>, Error>
[src]
&'a self,
instance: &'a Value
) -> Result<Vec<ValidationError<'a>>, Error>
Validate an instance against the default schema the registry.
See validate_by_uri
for possible error
conditions.
pub fn validate_by_id(
&'a self,
id: &'a Option<Url>,
instance: &'a Value
) -> Result<Vec<ValidationError<'a>>, Error>
[src]
&'a self,
id: &'a Option<Url>,
instance: &'a Value
) -> Result<Vec<ValidationError<'a>>, Error>
Validate an instance against the schema with the given URI.
Returns an error if the registry is currently unsealed (see
Registry::is_sealed
), or if
the maximum reference depth is exceeded (see
ValidatorConfig::max_depth
).
The generated errors have the same lifetime as the inputted instance; this crate avoids copying data out of your inputted data.
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,