Struct erg_compiler::module::global::SharedCompilerResource
source · pub struct SharedCompilerResource {
pub mod_cache: SharedModuleCache,
pub py_mod_cache: SharedModuleCache,
pub index: SharedModuleIndex,
pub graph: SharedModuleGraph,
pub trait_impls: SharedTraitImpls,
pub promises: SharedPromises,
pub errors: SharedCompileErrors,
pub warns: SharedCompileWarnings,
}
Fields§
§mod_cache: SharedModuleCache
§py_mod_cache: SharedModuleCache
§index: SharedModuleIndex
§graph: SharedModuleGraph
§trait_impls: SharedTraitImpls
K: name of a trait, V: (type, monomorphised trait that the type implements) K: トレイトの名前, V: (型, その型が実装する単相化トレイト) e.g. { “Named”: [(Type, Named), (Func, Named), …], “Add”: [(Nat, Add(Nat)), (Int, Add(Int)), …], … }
promises: SharedPromises
§errors: SharedCompileErrors
§warns: SharedCompileWarnings
Implementations§
sourcepub fn new(cfg: ErgConfig) -> Self
pub fn new(cfg: ErgConfig) -> Self
Initialize the shared compiler resource. This API is normally called only once throughout the compilation phase.
pub fn inherit<P: Into<NormalizedPathBuf>>(&self, path: P) -> Self
sourcepub fn clear(&self, path: &NormalizedPathBuf) -> Option<ModuleEntry>
pub fn clear(&self, path: &NormalizedPathBuf) -> Option<ModuleEntry>
Clear all information about the module. Graph information is not cleared (due to ELS).
pub fn clear_path(&self, path: &NormalizedPathBuf)
pub fn rename_path(&self, old: &NormalizedPathBuf, new: NormalizedPathBuf)
pub fn insert_module(&self, path: NormalizedPathBuf, entry: ModuleEntry)
sourcepub fn remove_module(&self, path: &Path) -> Option<ModuleEntry>
pub fn remove_module(&self, path: &Path) -> Option<ModuleEntry>
This is intended to be called from a language server, etc., this blocks until it gets a lock.
pub fn get_module( &self, path: &Path ) -> Option<MappedRwLockReadGuard<'_, ModuleEntry>>
pub fn raw_ref_ctx_with_timeout( &self, path: &Path, timeout: Duration ) -> Option<&ModuleContext>
pub fn raw_ref_builtins_ctx(&self) -> Option<&ModuleContext>
pub fn raw_modules(&self) -> impl Iterator<Item = &ModuleEntry>
pub fn raw_path_and_modules( &self ) -> impl Iterator<Item = (&NormalizedPathBuf, &ModuleEntry)>
Trait Implementations§
source§fn clone(&self) -> SharedCompilerResource
fn clone(&self) -> SharedCompilerResource
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() -> SharedCompilerResource
fn default() -> SharedCompilerResource
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