Skip to main content

Task

Struct Task 

Source
pub struct Task {
Show 18 fields pub transid: String, pub termid: String, pub userid: String, pub applid: String, pub sysid: String, pub number: u32, pub commarea: Option<Vec<u8>>, pub files: HashMap<String, FileDef>, pub ts: BTreeMap<String, TsQueue>, pub td: BTreeMap<String, Vec<Vec<u8>>>, pub td_files: HashMap<String, PathBuf>, pub held: HashMap<String, Vec<u8>>, pub browses: HashMap<(String, i64), Browse>, pub terminal: Option<Box<dyn Terminal>>, pub initial_aid: Option<u8>, pub mapsets: HashMap<String, Mapset>, pub next_transid: Option<String>, pub returned_commarea: Option<Vec<u8>>,
}
Expand description

The task: who and what started it, and the resources it has touched.

Fields§

§transid: String§termid: String§userid: String§applid: String§sysid: String§number: u32§commarea: Option<Vec<u8>>

The COMMAREA the task starts with; EIBCALEN is its length.

§files: HashMap<String, FileDef>§ts: BTreeMap<String, TsQueue>§td: BTreeMap<String, Vec<Vec<u8>>>§td_files: HashMap<String, PathBuf>

TD queues whose items are appended to a host file as text lines when the task ends.

§held: HashMap<String, Vec<u8>>

The key each file’s READ UPDATE holds, for REWRITE, DELETE and UNLOCK.

§browses: HashMap<(String, i64), Browse>

Open browses by file and REQID.

§terminal: Option<Box<dyn Terminal>>§initial_aid: Option<u8>

The AID key whose input started the task, as EIBAID shows it before any RECEIVE.

§mapsets: HashMap<String, Mapset>

Mapsets already read from the copy libraries, by name.

§next_transid: Option<String>

RETURN TRANSID and COMMAREA, when the task ended that way.

§returned_commarea: Option<Vec<u8>>

Implementations§

Source§

impl Task

Source

pub fn writeq_ts( &mut self, queue: &str, rewrite: Option<usize>, data: &[u8], ) -> Result<usize, &'static str>

WRITEQ TS: appends and returns the new item’s number; with Some(item) (REWRITE) replaces that item and returns it.

Source

pub fn readq_ts( &mut self, queue: &str, item: Option<usize>, ) -> Result<(Vec<u8>, usize), &'static str>

READQ TS: Some(item) reads that item; None reads the next item after the last read.

Source

pub fn deleteq_ts(&mut self, queue: &str) -> Result<(), &'static str>

DELETEQ TS.

Source

pub fn writeq_td(&mut self, queue: &str, data: &[u8])

WRITEQ TD: appends (creating the queue).

Source

pub fn readq_td(&mut self, queue: &str) -> Result<Vec<u8>, &'static str>

READQ TD: removes and returns the oldest item.

Source

pub fn deleteq_td(&mut self, queue: &str)

DELETEQ TD: empties the queue (no error when absent).

Source

pub fn flush_td(&mut self, page: &CodePage) -> Result<()>

Appends each TD queue that has a td_files entry to its file, one line per item, each item decoded through page with trailing spaces trimmed; then empties those queues.

Trait Implementations§

Source§

impl Debug for Task

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Task

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Task

§

impl !Send for Task

§

impl !Sync for Task

§

impl !UnwindSafe for Task

§

impl Freeze for Task

§

impl Unpin for Task

§

impl UnsafeUnpin for Task

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.