pub struct Modules {
pub dirs: Vec<PathBuf>,
/* private fields */
}Fields§
§dirs: Vec<PathBuf>Searched in order for NAME.iwm.
Implementations§
Source§impl Modules
impl Modules
pub fn new(dirs: Vec<PathBuf>, check: Check) -> Self
Sourcepub fn add(&mut self, path: PathBuf, module: LoadedModule) -> usize
pub fn add(&mut self, path: PathBuf, module: LoadedModule) -> usize
Registers a module read from path, whose programs are found by name from now on; its
number is what Modules::take takes.
Sourcepub fn add_first(&mut self, path: PathBuf, module: LoadedModule) -> usize
pub fn add_first(&mut self, path: PathBuf, module: LoadedModule) -> usize
Registers the module the run began with, as Modules::add does; a program of the same
source as its program 0 is loaded with no files to record, as a program of the run’s first
source is.
Sourcepub fn take(
&mut self,
k: usize,
ordinal: usize,
) -> Option<Result<LoadedProgram<Rc<Code>>, String>>
pub fn take( &mut self, k: usize, ordinal: usize, ) -> Option<Result<LoadedProgram<Rc<Code>>, String>>
Program ordinal of module k for the run unit, checked; None once taken.
Sourcepub fn loaded(
&mut self,
name: &str,
) -> Option<Result<LoadedProgram<Rc<Code>>, LoadError>>
pub fn loaded( &mut self, name: &str, ) -> Option<Result<LoadedProgram<Rc<Code>>, LoadError>>
A program of a module already read that no CALL has taken, by the name a CALL gives: the first such module, and in it the lowest ordinal.
Sourcepub fn search(
&mut self,
name: &str,
) -> Result<LoadedProgram<Rc<Code>>, LoadError>
pub fn search( &mut self, name: &str, ) -> Result<LoadedProgram<Rc<Code>>, LoadError>
NAME.iwm, then name.iwm, in each directory in turn. A module found that cannot be read,
or that holds no program NAME, is an error, not “not found”.
Sourcepub fn holder(&self, entry: &str) -> Option<String>
pub fn holder(&self, entry: &str) -> Option<String>
The PROGRAM-ID of a program not yet taken, of a module already read, with this ENTRY name.
Sourcepub fn loaded_class(
&mut self,
external: &str,
) -> Result<Option<FoundClass<Rc<ClassCode<Rc<Code>>>>>, String>
pub fn loaded_class( &mut self, external: &str, ) -> Result<Option<FoundClass<Rc<ClassCode<Rc<Code>>>>>, String>
The COBOL class definition of this external name in a module already read, not yet taken.