Struct stc_ts_type_checker::loader::ModuleLoader
source · [−]pub struct ModuleLoader<L, R>where
L: LoadFile,
R: 'static + Sync + Send + Resolve,{
cm: Arc<SourceMap>,
env: Env,
resolver: R,
loader: L,
comments: StcComments,
loading_started: DashSet<Arc<FileName>, FxBuildHasher>,
dep_graph: RwLock<FastDiGraphMap<ModuleId, ()>>,
cycles: RwLock<Vec<Vec<ModuleId>>>,
ids: ModuleIdGenerator,
parse_cache: DashMap<Arc<FileName>, (Arc<ModuleRecord>, StcComments), FxBuildHasher>,
parsing_errors: Mutex<Vec<Error>>,
}
Expand description
A simple implementation of LoadModule.
Fields
cm: Arc<SourceMap>
env: Env
resolver: R
loader: L
comments: StcComments
TODO(kdu1): Split the
loading_started: DashSet<Arc<FileName>, FxBuildHasher>
dep_graph: RwLock<FastDiGraphMap<ModuleId, ()>>
cycles: RwLock<Vec<Vec<ModuleId>>>
ids: ModuleIdGenerator
parse_cache: DashMap<Arc<FileName>, (Arc<ModuleRecord>, StcComments), FxBuildHasher>
parsing_errors: Mutex<Vec<Error>>
Implementations
sourceimpl<L, R> ModuleLoader<L, R>where
L: LoadFile,
R: Resolve,
impl<L, R> ModuleLoader<L, R>where
L: LoadFile,
R: Resolve,
pub fn new(cm: Arc<SourceMap>, env: Env, resolver: R, loader: L) -> Self
fn load_recursively(
&self,
filename: &Arc<FileName>,
calc_cycles: bool
) -> Result<ModuleId>
fn parse(
&self,
filename: &Arc<FileName>
) -> Result<(Arc<ModuleRecord>, StcComments)>
sourcefn parse_inner(
&self,
filename: &Arc<FileName>
) -> Result<(Arc<ModuleRecord>, StcComments)>
fn parse_inner(
&self,
filename: &Arc<FileName>
) -> Result<(Arc<ModuleRecord>, StcComments)>
This does not perform caching
Trait Implementations
sourceimpl<L, R> LoadModule for ModuleLoader<L, R>where
L: LoadFile,
R: 'static + Sync + Send + Resolve,
impl<L, R> LoadModule for ModuleLoader<L, R>where
L: LoadFile,
R: 'static + Sync + Send + Resolve,
Auto Trait Implementations
impl<L, R> !RefUnwindSafe for ModuleLoader<L, R>
impl<L, R> Send for ModuleLoader<L, R>
impl<L, R> Sync for ModuleLoader<L, R>
impl<L, R> Unpin for ModuleLoader<L, R>where
L: Unpin,
R: Unpin,
impl<L, R> !UnwindSafe for ModuleLoader<L, R>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more