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).
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModuleSet
impl RefUnwindSafe for ModuleSet
impl Send for ModuleSet
impl Sync for ModuleSet
impl Unpin for ModuleSet
impl UnsafeUnpin for ModuleSet
impl UnwindSafe for ModuleSet
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more