pub struct DirectorySchema<'t> { /* private fields */ }Expand description
A DirectorySchema is a container of variables, definitions (named schemas) and a directory listing
Implementations§
Source§impl<'t> DirectorySchema<'t>
impl<'t> DirectorySchema<'t>
Sourcepub fn new(
vars: HashMap<Identifier<'t>, Expression<'t>>,
defs: HashMap<Identifier<'t>, SchemaNode<'t>>,
entries: Vec<(Binding<'t>, SchemaNode<'t>)>,
) -> Self
pub fn new( vars: HashMap<Identifier<'t>, Expression<'t>>, defs: HashMap<Identifier<'t>, SchemaNode<'t>>, entries: Vec<(Binding<'t>, SchemaNode<'t>)>, ) -> Self
Constructs a new description of a directory in the schema
Sourcepub fn vars(&self) -> &HashMap<Identifier<'t>, Expression<'t>>
pub fn vars(&self) -> &HashMap<Identifier<'t>, Expression<'t>>
Provides access to the variables defined in this node
Sourcepub fn get_var<'a>(&'a self, id: &Identifier<'a>) -> Option<&'a Expression<'t>>
pub fn get_var<'a>(&'a self, id: &Identifier<'a>) -> Option<&'a Expression<'t>>
Returns the expression associated with the given variable, if any was set in the schema
Sourcepub fn defs(&self) -> &HashMap<Identifier<'_>, SchemaNode<'_>>
pub fn defs(&self) -> &HashMap<Identifier<'_>, SchemaNode<'_>>
Provides access to the sub-schema definitions defined in this node
Sourcepub fn get_def<'a>(&'a self, id: &Identifier<'a>) -> Option<&'a SchemaNode<'t>>
pub fn get_def<'a>(&'a self, id: &Identifier<'a>) -> Option<&'a SchemaNode<'t>>
Returns the sub-schema associated with the given definition, if any was set in the schema
Sourcepub fn entries(&self) -> &[(Binding<'t>, SchemaNode<'t>)]
pub fn entries(&self) -> &[(Binding<'t>, SchemaNode<'t>)]
Provides access to the child nodes of this node, with their bindings
Trait Implementations§
Source§impl<'t> Clone for DirectorySchema<'t>
impl<'t> Clone for DirectorySchema<'t>
Source§fn clone(&self) -> DirectorySchema<'t>
fn clone(&self) -> DirectorySchema<'t>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'t> Debug for DirectorySchema<'t>
impl<'t> Debug for DirectorySchema<'t>
Source§impl<'t> Default for DirectorySchema<'t>
impl<'t> Default for DirectorySchema<'t>
Source§fn default() -> DirectorySchema<'t>
fn default() -> DirectorySchema<'t>
Returns the “default value” for a type. Read more
Source§impl<'t> PartialEq for DirectorySchema<'t>
impl<'t> PartialEq for DirectorySchema<'t>
impl<'t> StructuralPartialEq for DirectorySchema<'t>
Auto Trait Implementations§
impl<'t> Freeze for DirectorySchema<'t>
impl<'t> RefUnwindSafe for DirectorySchema<'t>
impl<'t> Send for DirectorySchema<'t>
impl<'t> Sync for DirectorySchema<'t>
impl<'t> Unpin for DirectorySchema<'t>
impl<'t> UnwindSafe for DirectorySchema<'t>
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