Skip to main content

RunUnit

Struct RunUnit 

Source
pub struct RunUnit<'w> {
    pub mem: Vec<u8>,
    pub depth: usize,
    pub programs: Vec<Loaded>,
    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>,
    /* private fields */
}

Fields§

§mem: Vec<u8>§depth: usize

PERFORMs and CALLs in progress, across every program.

§programs: Vec<Loaded>§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>

Implementations§

Source§

impl<'w> RunUnit<'w>

Source

pub fn new( library: Library, 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( &mut self, compiled: Option<Rc<Compiled>>, program: &Program, size: usize, ) -> usize

Adds a program to the run unit and gives it its storage.

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 was loaded behind them.

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 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 copy_libraries(&self) -> &Libraries

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> !RefUnwindSafe for RunUnit<'w>

§

impl<'w> !Send for RunUnit<'w>

§

impl<'w> !Sync for RunUnit<'w>

§

impl<'w> !UnwindSafe for RunUnit<'w>

§

impl<'w> Freeze for RunUnit<'w>

§

impl<'w> Unpin for RunUnit<'w>

§

impl<'w> UnsafeUnpin for RunUnit<'w>

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.