Struct erg_compiler::module::cache::ModuleCache
source · pub struct ModuleCache { /* private fields */ }
Expand description
Caches checked modules. In addition to being queried here when re-imported, it is also used when linking (Erg links all scripts defined in erg and outputs them to a single pyc file).
Implementations§
source§impl ModuleCache
impl ModuleCache
pub fn new() -> Self
pub fn get<P: Eq + Hash + ?Sized>(&self, path: &P) -> Option<&ModuleEntry>where PathBuf: Borrow<P>,
pub fn get_mut<Q: Eq + Hash + ?Sized>( &mut self, path: &Q ) -> Option<&mut ModuleEntry>where PathBuf: Borrow<Q>,
pub fn register(&mut self, path: PathBuf, hir: Option<HIR>, ctx: ModuleContext)
pub fn remove<Q: Eq + Hash + ?Sized>(&mut self, path: &Q) -> Option<ModuleEntry>where PathBuf: Borrow<Q>,
pub fn remove_by_id(&mut self, id: ModId) -> Option<ModuleEntry>
pub fn get_similar_name(&self, name: &str) -> Option<Str>
Trait Implementations§
source§impl Debug for ModuleCache
impl Debug for ModuleCache
source§impl Default for ModuleCache
impl Default for ModuleCache
source§fn default() -> ModuleCache
fn default() -> ModuleCache
Returns the “default value” for a type. Read more