Skip to main content

Modules

Struct Modules 

Source
pub struct Modules {
    pub dirs: Vec<PathBuf>,
    /* private fields */
}

Fields§

§dirs: Vec<PathBuf>

Searched in order for NAME.iwm.

Implementations§

Source§

impl Modules

Source

pub fn new(dirs: Vec<PathBuf>, check: Check) -> Self

Source

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.

Source

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.

Source

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.

Source

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.

Source

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”.

Source

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.

Source

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.

Source

pub fn search_class( &mut self, external: &str, ) -> Result<Option<FoundClass<Rc<ClassCode<Rc<Code>>>>>, String>

The COBOL class definition of this external name in a module named as the source search names the class’s source (numeric::assumptions::CLASS_SEARCH), in each directory in turn.

Source

pub fn mapset(&self, name: &str) -> Option<Mapset>

A mapset a module already read holds.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.