pub struct ModuleSource<'a> {
pub name: String,
pub file: &'a File,
pub imports: HashMap<String, ImportTarget>,
pub text: Option<&'a str>,
pub package: Option<u32>,
pub importable: Vec<(String, usize)>,
}Expand description
A source module: a parsed file, its label, and what its imports name.
Fields§
§name: StringA label for the module. Messages print an import as written, so the label is never a lookup key.
file: &'a File§imports: HashMap<String, ImportTarget>What each import names, by its first segment. An import missing here is “cannot find module”.
text: Option<&'a str>The module’s source text, for fixes placed by lines (spec
docs/superpowers/specs/2026-10-10-phase-3-4b-fixes-and-colour-design.md
§4.7). None in the resolver’s own tests.
package: Option<u32>A key equal for two modules of one package; None for a loose
program, whose files count as one package (spec 3.4b §4.6).
importable: Vec<(String, usize)>Every loaded module this one could import: the name an import of it
writes, and its index in modules (spec 3.4b §4.6).
Implementations§
Source§impl<'a> ModuleSource<'a>
impl<'a> ModuleSource<'a>
Auto Trait Implementations§
impl<'a> Freeze for ModuleSource<'a>
impl<'a> RefUnwindSafe for ModuleSource<'a>
impl<'a> Send for ModuleSource<'a>
impl<'a> Sync for ModuleSource<'a>
impl<'a> Unpin for ModuleSource<'a>
impl<'a> UnsafeUnpin for ModuleSource<'a>
impl<'a> UnwindSafe for ModuleSource<'a>
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