Struct diskplan_schema::DirectorySchema
source · 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 copy 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>
source§fn eq(&self, other: &DirectorySchema<'t>) -> bool
fn eq(&self, other: &DirectorySchema<'t>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'t> StructuralPartialEq for DirectorySchema<'t>
Auto Trait Implementations§
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