pub trait SortHost<'a, P: Copy, X: Copy>: Files<P, X> {
type Register: Copy;
type Procedure: Copy;
type File;
type Keys;
Show 13 methods
// Required methods
fn locate_register(
&mut self,
register: Self::Register,
) -> Result<Loc, Abend>;
fn register_value(
&mut self,
register: Self::Register,
pos: Pos,
) -> Result<i64, Abend>;
fn file_index(&self, file: &Self::File, pos: Pos) -> Result<usize, Abend>;
fn keys(
&mut self,
keys: &Self::Keys,
pos: Pos,
) -> Result<Vec<ItemKey>, Abend>;
fn sort_file(&self, k: usize) -> SortFile<'a, P, X>;
fn active(&mut self) -> &mut Option<Active>;
fn open(&mut self, k: usize, mode: OpenMode, pos: Pos) -> Result<(), Abend>;
fn close(&mut self, k: usize, pos: Pos) -> Result<bool, Abend>;
fn put(&mut self, k: usize, loc: Loc, pos: Pos) -> Result<bool, Abend>;
fn fail(
&mut self,
k: usize,
status: FileStatus,
mode: Option<OpenMode>,
message: String,
pos: Pos,
) -> Result<(), Abend>;
fn has_error_procedure(&self, k: usize, mode: OpenMode) -> bool;
fn run_procedure(
&mut self,
procedure: Self::Procedure,
kind: Procedure,
pos: Pos,
) -> Result<Option<Ending>, Abend>;
fn err(&mut self) -> &mut dyn Write;
}Expand description
What a SORT or MERGE asks of the executor beyond Files: its handles to the special registers,
procedures, files and keys the statement names, the file statements with their EXCEPTION/ERROR
procedures, running a procedure, and where the sort in progress is kept.
Required Associated Types§
Required Methods§
fn locate_register(&mut self, register: Self::Register) -> Result<Loc, Abend>
fn register_value( &mut self, register: Self::Register, pos: Pos, ) -> Result<i64, Abend>
fn file_index(&self, file: &Self::File, pos: Pos) -> Result<usize, Abend>
fn keys(&mut self, keys: &Self::Keys, pos: Pos) -> Result<Vec<ItemKey>, Abend>
fn sort_file(&self, k: usize) -> SortFile<'a, P, X>
fn active(&mut self) -> &mut Option<Active>
Sourcefn open(&mut self, k: usize, mode: OpenMode, pos: Pos) -> Result<(), Abend>
fn open(&mut self, k: usize, mode: OpenMode, pos: Pos) -> Result<(), Abend>
OPEN of file k, as the statement runs it.
Sourcefn close(&mut self, k: usize, pos: Pos) -> Result<bool, Abend>
fn close(&mut self, k: usize, pos: Pos) -> Result<bool, Abend>
CLOSE of file k; true when it failed.
Sourcefn put(&mut self, k: usize, loc: Loc, pos: Pos) -> Result<bool, Abend>
fn put(&mut self, k: usize, loc: Loc, pos: Pos) -> Result<bool, Abend>
WRITE of the record at loc to file k, with no phrases; true when it failed.
Sourcefn fail(
&mut self,
k: usize,
status: FileStatus,
mode: Option<OpenMode>,
message: String,
pos: Pos,
) -> Result<(), Abend>
fn fail( &mut self, k: usize, status: FileStatus, mode: Option<OpenMode>, message: String, pos: Pos, ) -> Result<(), Abend>
Records a status of file k, open in mode or being opened in it, and takes the file’s
error path when it fails.
Sourcefn has_error_procedure(&self, k: usize, mode: OpenMode) -> bool
fn has_error_procedure(&self, k: usize, mode: OpenMode) -> bool
Whether an EXCEPTION/ERROR procedure applies to file k in mode.
Sourcefn run_procedure(
&mut self,
procedure: Self::Procedure,
kind: Procedure,
pos: Pos,
) -> Result<Option<Ending>, Abend>
fn run_procedure( &mut self, procedure: Self::Procedure, kind: Procedure, pos: Pos, ) -> Result<Option<Ending>, Abend>
Runs an input or output procedure; the Ending of a STOP RUN or GOBACK in it.
fn err(&mut self) -> &mut dyn Write
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".