pub struct RootSchema {
pub meta_schema: Option<String>,
pub schema: YamlSchema,
pub base_uri: Option<Url>,
}Expand description
A RootSchema represents the root document in a schema document, and includes additional
fields such as $schema that are not allowed in subschemas. It also provides a way to
resolve references to other schemas.
Fields§
§meta_schema: Option<String>§schema: YamlSchema§base_uri: Option<Url>Base URI for resolving relative $ref values (from file path, URL, or $id).
Implementations§
Source§impl RootSchema
impl RootSchema
Sourcepub fn new(schema: YamlSchema) -> Self
pub fn new(schema: YamlSchema) -> Self
Create a new RootSchema with a given schema
Sourcepub fn cache_key(&self, fallback: &str) -> String
pub fn cache_key(&self, fallback: &str) -> String
Returns the preferred key for caching this schema: $id if it is a valid URI,
otherwise the given fallback (e.g. the file or fetch URI).
Sourcepub fn resolve(&self, pointer: &Pointer) -> Option<&YamlSchema>
pub fn resolve(&self, pointer: &Pointer) -> Option<&YamlSchema>
Resolve a JSON Pointer to an element in the schema.
Trait Implementations§
Source§impl Debug for RootSchema
impl Debug for RootSchema
Source§impl PartialEq for RootSchema
impl PartialEq for RootSchema
Source§impl<'r> TryFrom<&MarkedYaml<'r>> for RootSchema
impl<'r> TryFrom<&MarkedYaml<'r>> for RootSchema
Source§impl Validator for RootSchema
impl Validator for RootSchema
impl StructuralPartialEq for RootSchema
Auto Trait Implementations§
impl Freeze for RootSchema
impl RefUnwindSafe for RootSchema
impl Send for RootSchema
impl Sync for RootSchema
impl Unpin for RootSchema
impl UnsafeUnpin for RootSchema
impl UnwindSafe for RootSchema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more