pub struct Schemas { /* private fields */ }
Expand description
Collection of compiled schemas.
Implementations§
source§impl Schemas
impl Schemas
pub fn new() -> Self
sourcepub fn contains(&self, sch_index: SchemaIndex) -> bool
pub fn contains(&self, sch_index: SchemaIndex) -> bool
Returns true if sch_index
is generated for this instance.
sourcepub fn validate<'s, 'v>(
&'s self,
v: &'v Value,
sch_index: SchemaIndex
) -> Result<(), ValidationError<'s, 'v>>
pub fn validate<'s, 'v>( &'s self, v: &'v Value, sch_index: SchemaIndex ) -> Result<(), ValidationError<'s, 'v>>
Validates v
with schema identified by sch_index
Panics
Panics if sch_index
is not generated for this instance.
Schemas::contains
can be used too ensure that it does not panic.