Struct jsonschema_valid_compat::Config[][src]

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

A structure to hold configuration for a validation run.

Implementations

impl<'a> Config<'a>[src]

pub fn get_validator<'v>(
    &self,
    key: &'v str
) -> Option<fn(cfg: &'v Config<'v>, instance: &'v Value, schema: &'v Value, parent_schema: Option<&'v Value>, ref_context: Context<'v>) -> ErrorIterator<'v>>
[src]

Get the validator object for the draft in use.

pub fn get_format_checker(
    &self,
    key: &str
) -> Option<fn(cfg: &Config<'_>, value: &str) -> bool>
[src]

Get the string format checker for the draft in use.

pub fn get_draft_number(&self) -> u8[src]

Get the draft number in use.

pub fn get_metaschema(&self) -> &Value[src]

Get the metaschema associated with the draft in use.

pub fn get_resolver(&self) -> &Resolver<'a>[src]

Get the resolver for the parsing context.

pub fn get_schema(&self) -> &Value[src]

Get the schema currently being checked against.

pub fn from_schema(
    schema: &'a Value,
    draft: Option<Draft>
) -> Result<Config<'a>, ValidationError>
[src]

Create a new Config object from a given schema.

Will use the Draft of JSON schema specified by draft. If draft is None, it will be automatically determined from the $schema entry in the given schema. If no $schema entry is present Draft 7 will be used by default.

pub fn validate(&'a self, instance: &'a Value) -> Result<(), ErrorIterator<'a>>[src]

Validate the given JSON instance against the schema.

pub fn validate_schema(&'a self) -> Result<(), ErrorIterator<'a>>[src]

Validate the schema in this Config object against the metaschema.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Config<'a>

impl<'a> Send for Config<'a>

impl<'a> Sync for Config<'a>

impl<'a> Unpin for Config<'a>

impl<'a> UnwindSafe for Config<'a>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.