Struct diskplan_config::Stems
source · pub struct Stems<'t> { /* private fields */ }
Expand description
Collection of rooted schemas; a map of each Root
to the SchemaNode
configured for this root
Implementations§
source§impl<'t> Stems<'t>
impl<'t> Stems<'t>
sourcepub fn add(&mut self, root: Root, schema_path: impl AsRef<Utf8Path>)
pub fn add(&mut self, root: Root, schema_path: impl AsRef<Utf8Path>)
Configures the given root
path with the path where a schema for this root may be found
sourcepub fn add_precached(
&mut self,
root: Root,
schema_path: impl AsRef<Utf8Path>,
schema: SchemaNode<'t>
)
pub fn add_precached( &mut self, root: Root, schema_path: impl AsRef<Utf8Path>, schema: SchemaNode<'t> )
Configures the given root
path with the path where a schema for this root may be found
but then populates the internal cache with the schema data itself, avoiding any disk access
This is primarily used for tests
sourcepub fn roots(&self) -> impl Iterator<Item = &Root>
pub fn roots(&self) -> impl Iterator<Item = &Root>
Returns an iterator over the roots configures in this map
sourcepub fn schema_for<'s, 'p>(
&'s self,
path: &'p Utf8Path
) -> Result<(&SchemaNode<'t>, &Root)>where
's: 't,
pub fn schema_for<'s, 'p>( &'s self, path: &'p Utf8Path ) -> Result<(&SchemaNode<'t>, &Root)>where 's: 't,
Looks up the schema associated with the root of a given path
within this root
Trait Implementations§
Auto Trait Implementations§
impl<'t> !RefUnwindSafe for Stems<'t>
impl<'t> Send for Stems<'t>
impl<'t> !Sync for Stems<'t>
impl<'t> Unpin for Stems<'t>
impl<'t> UnwindSafe for Stems<'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