[−][src]Struct yaml_validator::Context
Contains a number of schemas that may or may not be dependent on each other.
Methods
impl<'schema> Context<'schema>
[src]
pub fn get_schema(&self, uri: &str) -> Option<&Schema<'schema>>
[src]
Get a reference to a single schema within the context to use for validation.
Examples
let schemas = vec![ YamlLoader::load_from_str(r#" uri: just-a-number schema: type: integer "#).unwrap().remove(0) ]; let context = Context::try_from(&schemas).unwrap(); let document = YamlLoader::load_from_str("10").unwrap().remove(0); context.get_schema("just-a-number").unwrap() .validate(&context, &document).unwrap();
Trait Implementations
impl<'schema> Debug for Context<'schema>
[src]
impl<'schema> Default for Context<'schema>
[src]
impl<'schema> TryFrom<&'schema Vec<Yaml>> for Context<'schema>
[src]
A context can only be created from a vector of Yaml documents, all of which must fit the schema layout.
Auto Trait Implementations
impl<'schema> RefUnwindSafe for Context<'schema>
impl<'schema> Send for Context<'schema>
impl<'schema> Sync for Context<'schema>
impl<'schema> Unpin for Context<'schema>
impl<'schema> UnwindSafe for Context<'schema>
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>,