[−][src]Struct jsonschema_valid::Config
A structure to hold configuration for a validation run.
Methods
impl<'a> Config<'a>
[src]
pub fn get_validator(
&self,
key: &str
) -> Option<fn(cfg: &'a Config<'a>, instance: &'a Value, schema: &'a Value, parent_schema: Option<&'a Value>, ref_context: Context<'a>) -> ErrorIterator<'a>>
[src]
&self,
key: &str
) -> Option<fn(cfg: &'a Config<'a>, instance: &'a Value, schema: &'a Value, parent_schema: Option<&'a Value>, ref_context: Context<'a>) -> ErrorIterator<'a>>
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]
&self,
key: &str
) -> Option<fn(cfg: &Config, value: &str) -> bool>
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<&'a dyn Draft>
) -> Result<Config<'a>, ValidationError>
[src]
schema: &'a Value,
draft: Option<&'a dyn Draft>
) -> Result<Config<'a>, ValidationError>
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 shema
. 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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,