Struct erg_compiler::module::cache::SharedModuleCache
source · pub struct SharedModuleCache(/* private fields */);
Implementations§
pub fn new() -> Self
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn get<Q: Eq + Hash + ?Sized>(
&self,
path: &Q
) -> Option<MappedRwLockReadGuard<'_, ModuleEntry>>where
NormalizedPathBuf: Borrow<Q>,
pub fn get_mut<Q: Eq + Hash + ?Sized>(
&self,
path: &Q
) -> Option<MappedRwLockWriteGuard<'_, ModuleEntry>>where
NormalizedPathBuf: Borrow<Q>,
pub fn ref_ctx<Q: Eq + Hash + ?Sized>(
&self,
path: &Q
) -> Option<MappedRwLockReadGuard<'_, ModuleContext>>where
NormalizedPathBuf: Borrow<Q>,
sourcepub fn raw_ref_ctx<Q: Eq + Hash + ?Sized>(
&self,
path: &Q
) -> Option<&ModuleContext>where
NormalizedPathBuf: Borrow<Q>,
pub fn raw_ref_ctx<Q: Eq + Hash + ?Sized>(
&self,
path: &Q
) -> Option<&ModuleContext>where
NormalizedPathBuf: Borrow<Q>,
FIXME: see the comment in this function
pub fn raw_ref_ctx_with_timeout<Q: Eq + Hash + ?Sized>(
&self,
path: &Q,
timeout: Duration
) -> Option<&ModuleContext>where
NormalizedPathBuf: Borrow<Q>,
pub fn raw_ref_builtins_ctx(&self) -> Option<&ModuleContext>
pub fn register<P: Into<NormalizedPathBuf>>( &self, path: P, ast: Option<Module>, hir: Option<HIR>, ctx: ModuleContext, status: CheckStatus )
pub fn insert(&self, path: NormalizedPathBuf, entry: ModuleEntry)
pub fn remove<Q: Eq + Hash + ?Sized>(&self, path: &Q) -> Option<ModuleEntry>where
NormalizedPathBuf: Borrow<Q>,
pub fn try_remove<Q: Eq + Hash + ?Sized>(
&self,
path: &Q
) -> Result<Option<ModuleEntry>, ()>where
NormalizedPathBuf: Borrow<Q>,
pub fn remove_by_id(&self, id: ModId) -> Option<ModuleEntry>
pub fn get_similar_name(&self, name: &str) -> Option<Str>
pub fn initialize(&self)
pub fn rename_path<P: Into<NormalizedPathBuf>>( &self, path: &NormalizedPathBuf, new: P )
pub fn ref_inner( &self ) -> MappedRwLockReadGuard<'_, Dict<NormalizedPathBuf, ModuleEntry>>
pub fn raw_values(&self) -> impl Iterator<Item = &ModuleEntry>
pub fn raw_iter( &self ) -> impl Iterator<Item = (&NormalizedPathBuf, &ModuleEntry)>
Trait Implementations§
source§fn clone(&self) -> SharedModuleCache
fn clone(&self) -> SharedModuleCache
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§fn default() -> SharedModuleCache
fn default() -> SharedModuleCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
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