pub struct ModuleSet {
pub entry: ModulePath,
/* private fields */
}Expand description
The complete, deterministic set of modules for one compilation: the entry plus every transitively imported module.
Fields§
§entry: ModulePathImplementations§
Source§impl ModuleSet
impl ModuleSet
Sourcepub fn from_entry_file(
entry_file: &Path,
modules_root: Option<&Path>,
) -> Result<ModuleSet, ModuleError>
pub fn from_entry_file( entry_file: &Path, modules_root: Option<&Path>, ) -> Result<ModuleSet, ModuleError>
Walk the filesystem from entry_file, loading every transitively
imported module under modules_root (default: the entry file’s
directory — D115.8).
Only selective, unscoped imports load files; the refused forms
(D115.9) surface later with real locations, so an unresolvable
@scope path can never abort the load of an otherwise-valid
project.
Sourcepub fn from_memory(
files: &BTreeMap<String, String>,
entry: &str,
) -> Result<ModuleSet, ModuleError>
pub fn from_memory( files: &BTreeMap<String, String>, entry: &str, ) -> Result<ModuleSet, ModuleError>
Build from an in-memory bundle: root-relative file paths → sources.
entry names one of the keys. Every file must be reachable from
the entry through selective, unscoped imports — a bundle carrying
dead files is refused rather than silently shipping them (imports
are static; unreachable means unreferenced, and an artifact should
not quietly contain source nobody asked to link).
pub fn get(&self, path: &ModulePath) -> Option<&LoadedModule>
Sourcepub fn iter(&self) -> impl Iterator<Item = (&ModulePath, &LoadedModule)>
pub fn iter(&self) -> impl Iterator<Item = (&ModulePath, &LoadedModule)>
Deterministic iteration over (path, module).