pub struct InMemoryModuleCache { /* private fields */ }
Expand description
An implementation of ModuleStore
that has no persistence it simply acts as an in-process
cache.
Implementations§
Trait Implementations§
Source§impl Clone for InMemoryModuleCache
impl Clone for InMemoryModuleCache
Source§fn clone(&self) -> InMemoryModuleCache
fn clone(&self) -> InMemoryModuleCache
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 Debug for InMemoryModuleCache
impl Debug for InMemoryModuleCache
Source§impl ModuleStore for InMemoryModuleCache
impl ModuleStore for InMemoryModuleCache
Source§fn contains(&self, name: &Identifier) -> bool
fn contains(&self, name: &Identifier) -> bool
Returns
true
if the loader’s cache contains a module with the name name
, else false
.Source§fn contains_by_uri(&self, uri: &Url) -> bool
fn contains_by_uri(&self, uri: &Url) -> bool
Returns
true
if the loader’s cache contains a module with the base URI uri
, else false
.Source§fn get(&self, name: &Identifier) -> Option<&Module>
fn get(&self, name: &Identifier) -> Option<&Module>
Returns a reference to the
Module
identified by name
if the store contains it;
else None
.Source§fn get_mut(&mut self, name: &Identifier) -> Option<&mut Module>
fn get_mut(&mut self, name: &Identifier) -> Option<&mut Module>
Returns a mutable reference to the
Module
identified by name
if the store contains it;
else None
.Source§fn get_by_uri(&self, uri: &Url) -> Option<&Module>
fn get_by_uri(&self, uri: &Url) -> Option<&Module>
Returns a reference to the
Module
identified by uri
if the store contains it;
else None
.Source§fn get_by_uri_mut(&mut self, uri: &Url) -> Option<&mut Module>
fn get_by_uri_mut(&mut self, uri: &Url) -> Option<&mut Module>
Returns a mutable reference to the
Module
identified by uri
if the store contains it;
else None
.Source§fn modules(&self) -> impl Iterator<Item = &Module>
fn modules(&self) -> impl Iterator<Item = &Module>
Return an iterator over all modules in this store. This may be an expensive operation if
modules only exist in some backing store.
Source§fn module_names(&self) -> impl Iterator<Item = &Identifier>
fn module_names(&self) -> impl Iterator<Item = &Identifier>
Return an iterator over the names of the modules in this store.
Source§fn remove(&mut self, name: &Identifier) -> bool
fn remove(&mut self, name: &Identifier) -> bool
Remove any module identified by
name
.Source§fn remove_by_uri(&mut self, uri: &Url) -> bool
fn remove_by_uri(&mut self, uri: &Url) -> bool
Remove any module identified by
uri
.Source§fn uri_to_module_name(&self, url: &Url) -> Option<&Identifier>
fn uri_to_module_name(&self, url: &Url) -> Option<&Identifier>
Return the module name corresponding to the provided
url
if it exists, or else None
.Source§fn module_name_to_uri(&self, id: &Identifier) -> Option<&Url>
fn module_name_to_uri(&self, id: &Identifier) -> Option<&Url>
Return the module URI corresponding to the provided
name
if it exists, or else None
.Source§fn resolve(&self, definition: &QualifiedIdentifier) -> Option<&Definition>
fn resolve(&self, definition: &QualifiedIdentifier) -> Option<&Definition>
Given a qualified identifier, find the named module or return
None
, then find the named
member in the found module or return None
. Read moreSource§fn resolve_or_in(
&self,
definition: &IdentifierReference,
in_module: &Identifier,
) -> Option<&Definition>
fn resolve_or_in( &self, definition: &IdentifierReference, in_module: &Identifier, ) -> Option<&Definition>
If
definition
is a QualifiedIdentifier
this is the same as resolve
; however, if
definition
is an Identifier
then look for definition in the module named
in_module
. Read moreAuto Trait Implementations§
impl Freeze for InMemoryModuleCache
impl RefUnwindSafe for InMemoryModuleCache
impl Send for InMemoryModuleCache
impl Sync for InMemoryModuleCache
impl Unpin for InMemoryModuleCache
impl UnwindSafe for InMemoryModuleCache
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