Struct diskplan_config::SchemaCache
source · pub struct SchemaCache<'a> { /* private fields */ }
Expand description
An append-only cache of schemas (SchemaNode
roots) keyed by their on-disk file path
Implementations§
source§impl<'a> SchemaCache<'a>
impl<'a> SchemaCache<'a>
sourcepub fn load<'s, 'r>(
&'s self,
path: impl AsRef<Utf8Path>
) -> Result<&'r SchemaNode<'a>>where
's: 'a,
pub fn load<'s, 'r>( &'s self, path: impl AsRef<Utf8Path> ) -> Result<&'r SchemaNode<'a>>where 's: 'a,
Parses the file at the given path
, caches the parsed schema, and returns a reference to it
sourcepub fn inject(&self, path: impl AsRef<Utf8Path>, schema: SchemaNode<'a>)
pub fn inject(&self, path: impl AsRef<Utf8Path>, schema: SchemaNode<'a>)
Injects a path to schema mapping into the cache without loading from disk
This is primarily used for tests
Trait Implementations§
source§impl<'a> Default for SchemaCache<'a>
impl<'a> Default for SchemaCache<'a>
source§fn default() -> SchemaCache<'a>
fn default() -> SchemaCache<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for SchemaCache<'a>
impl<'a> Send for SchemaCache<'a>
impl<'a> !Sync for SchemaCache<'a>
impl<'a> Unpin for SchemaCache<'a>
impl<'a> UnwindSafe for SchemaCache<'a>
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