pub struct RootSchema {
pub id: Option<String>,
pub meta_schema: Option<String>,
pub defs: Option<LinkedHashMap<String, YamlSchema>>,
pub schema: Rc<YamlSchema>,
}Expand description
A RootSchema represents the root document in a schema file, and can include additional fields not present in the ‘base’ YamlSchema
Fields§
§id: Option<String>§meta_schema: Option<String>§defs: Option<LinkedHashMap<String, YamlSchema>>§schema: Rc<YamlSchema>Implementations§
Source§impl RootSchema
impl RootSchema
Sourcepub fn new(schema: YamlSchema) -> RootSchema
pub fn new(schema: YamlSchema) -> RootSchema
Create a new RootSchema with a YamlSchema
Sourcepub fn builder() -> RootSchemaBuilder
pub fn builder() -> RootSchemaBuilder
Builder pattern for RootSchema
Sourcepub fn new_with_schema(schema: Schema) -> RootSchema
pub fn new_with_schema(schema: Schema) -> RootSchema
Create a new RootSchema with a Schema
Sourcepub fn load_file(path: &str) -> Result<RootSchema>
pub fn load_file(path: &str) -> Result<RootSchema>
Load a RootSchema from a file
pub fn load_from_str(schema: &str) -> Result<RootSchema>
pub fn validate( &self, context: &Context<'_>, value: &MarkedYaml<'_>, ) -> Result<()>
pub fn get_def(&self, name: &str) -> Option<&YamlSchema>
Trait Implementations§
Source§impl Debug for RootSchema
impl Debug for RootSchema
Source§impl Default for RootSchema
impl Default for RootSchema
Source§fn default() -> RootSchema
fn default() -> RootSchema
Returns the “default value” for a type. Read more
Source§impl PartialEq for RootSchema
impl PartialEq 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 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