Skip to main content

RunUnit

Struct RunUnit 

Source
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: usize

PERFORMs 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: State

Language 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>

Source

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

Source

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.

Source

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

Source

pub fn push_temporary(&mut self, bytes: &[u8]) -> usize

Storage for a BY CONTENT or BY VALUE argument, at the end of memory.

Source

pub fn release_temporaries(&mut self, mark: usize)

Releases arguments pushed since mark, unless a program or heap storage was placed behind them.

Source

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.

Source

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.

Source

pub fn initialized(&mut self, me: usize)

Program me’s storage holds its initial values, and its GO TOs go where they are written.

Source

pub fn find(&self, name: &str) -> Option<usize>

Source

pub fn load(&mut self, name: &str) -> Result<usize, LoadError>

The program CALL names, compiling and loading it the first time.

Source

pub const fn observed(&self) -> bool

Source

pub fn notify(&mut self, event: Event<'_>)

Source

pub fn close_all(&mut self) -> Result<(), String>

Closes every file any program left open, as the runtime does when the run unit ends.

Source

pub fn return_code(&self) -> i16

Source

pub fn now(&self) -> (i64, u32)

The current time: seconds since the epoch, and hundredths.

Auto Trait Implementations§

§

impl<'w, H, L> !RefUnwindSafe for RunUnit<'w, H, L>

§

impl<'w, H, L> !Send for RunUnit<'w, H, L>

§

impl<'w, H, L> !Sync for RunUnit<'w, H, L>

§

impl<'w, H, L> !UnwindSafe for RunUnit<'w, H, L>

§

impl<'w, H, L> Freeze for RunUnit<'w, H, L>
where Vec<Loaded<H>>: Freeze, L: Freeze, Objects<<L as Loader<H>>::Class>: Freeze,

§

impl<'w, H, L> Unpin for RunUnit<'w, H, L>
where Vec<Loaded<H>>: Unpin, L: Unpin, Objects<<L as Loader<H>>::Class>: Unpin,

§

impl<'w, H, L> UnsafeUnpin for RunUnit<'w, H, L>

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.