[][src]Struct jsl::validator::Validator

pub struct Validator<'a> { /* fields omitted */ }

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]

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]

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

impl<'a> Send for Validator<'a>

impl<'a> Sync for Validator<'a>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]