rsynko_session/run.rs
1use crate::SessionSorts;
2use ambassador::delegatable_trait;
3
4/// Specifies reading one run while it happens, and ending it once it is over.
5#[delegatable_trait]
6pub trait RunReadAlg: SessionSorts {
7 /// States whether the run is over.
8 fn run_is_over(&self, run: &Self::Run) -> bool;
9
10 /// States everything the run has said since it was last read, without waiting for more.
11 fn read_run(&self, run: &mut Self::Run) -> Vec<Self::Report>;
12
13 /// Waits for a run that is over, and states how it ended.
14 ///
15 /// # Errors
16 ///
17 /// Returns the interpreter's own refusal, when the run ended by refusing.
18 fn end_run(&self, run: Self::Run) -> Result<Self::Ending, Self::Refusal>;
19}