pub struct RunUnit<'w, H, L: Loader<H>> {Show 17 fields
pub mem: Vec<u8>,
pub depth: usize,
pub programs: Vec<Loaded<H>>,
pub library: L,
pub dds: Dds,
pub sysin: Option<Box<dyn BufRead + 'w>>,
pub clock: Clock,
pub out: &'w mut dyn Write,
pub err: &'w mut dyn Write,
pub cics: Option<Task>,
pub eib: usize,
pub cics_files: HashMap<String, Open>,
pub sql: Option<Session<'w>>,
pub le: State,
pub oo: Objects<L::Class>,
pub observer: Option<Observer<'w>>,
pub random: Option<u32>,
/* private fields */
}Fields§
§mem: Vec<u8>§depth: usizePERFORMs and CALLs in progress, across every program.
programs: Vec<Loaded<H>>§library: L§dds: Dds§sysin: Option<Box<dyn BufRead + 'w>>§clock: Clock§out: &'w mut dyn Write§err: &'w mut dyn Write§cics: Option<Task>The CICS task a harness run stands in for, with its EXEC interface block and open files.
eib: usize§cics_files: HashMap<String, Open>§sql: Option<Session<'w>>The database EXEC SQL statements reach, when the run has one.
le: StateLanguage Environment’s heap storage and message files.
oo: Objects<L::Class>Classes, objects and the JNI environment of the run unit’s object-oriented programs.
observer: Option<Observer<'w>>Told what the run opens, closes and loads, when a caller keeps evidence of it.
random: Option<u32>FUNCTION RANDOM’s generator, one for the run unit, from the first reference on.
Implementations§
Source§impl<'w, H: Clone, L: Loader<H>> RunUnit<'w, H, L>
impl<'w, H: Clone, L: Loader<H>> RunUnit<'w, H, L>
pub fn new( library: L, dds: Dds, sysin: Option<Box<dyn BufRead + 'w>>, clock: Clock, out: &'w mut dyn Write, err: &'w mut dyn Write, ) -> Self
Sourcepub fn add_named(
&mut self,
compiled: Option<H>,
name: String,
files: usize,
size: usize,
) -> usize
pub fn add_named( &mut self, compiled: Option<H>, name: String, files: usize, size: usize, ) -> usize
Adds a program to the run unit under name and gives it its storage.
Sourcepub fn load_entry(
&mut self,
name: &str,
dynamic: bool,
) -> Result<(usize, Option<usize>), LoadError>
pub fn load_entry( &mut self, name: &str, dynamic: bool, ) -> Result<(usize, Option<usize>), LoadError>
The program a CALL of name enters, and which of its ENTRY statements when name is not
its PROGRAM-ID. A static CALL of an entry name enters the one copy of the program; a dynamic
CALL gets a copy of its own for each entry name (assumption C51).
Sourcepub fn push_temporary(&mut self, bytes: &[u8]) -> usize
pub fn push_temporary(&mut self, bytes: &[u8]) -> usize
Storage for a BY CONTENT or BY VALUE argument, at the end of memory.
Sourcepub fn release_temporaries(&mut self, mark: usize)
pub fn release_temporaries(&mut self, mark: usize)
Releases arguments pushed since mark, unless a program or heap storage was placed behind them.
Sourcepub fn enter(&mut self, pos: Pos) -> Result<(), Abend>
pub fn enter(&mut self, pos: Pos) -> Result<(), Abend>
One more PERFORM or CALL in progress, refused past MAX_DEPTH rather than exhaust the stack.
Sourcepub fn activate(&mut self, me: usize, initial: bool) -> (usize, bool)
pub fn activate(&mut self, me: usize, initial: bool) -> (usize, bool)
Marks program me active: where its storage starts, and whether the activation starts from
fresh storage, as its first does, the first after a CANCEL, and every one of an INITIAL
program.
Sourcepub fn initialized(&mut self, me: usize)
pub fn initialized(&mut self, me: usize)
Program me’s storage holds its initial values, and its GO TOs go where they are written.
pub fn find(&self, name: &str) -> Option<usize>
Sourcepub fn load(&mut self, name: &str) -> Result<usize, LoadError>
pub fn load(&mut self, name: &str) -> Result<usize, LoadError>
The program CALL names, compiling and loading it the first time.
pub const fn observed(&self) -> bool
pub fn notify(&mut self, event: Event<'_>)
Sourcepub fn close_all(&mut self) -> Result<(), String>
pub fn close_all(&mut self) -> Result<(), String>
Closes every file any program left open, as the runtime does when the run unit ends.