pub trait ManagerAttentionExt<This>where
This: QueueCatalogAlg + SafeExitAlg + TransferStateAlg + RehearsalStateAlg,
This::Entry: QueueEntryAlg,
This::Change: PlannedChangeAlg,
This::Id: Copy + Eq,{
// Required methods
fn wanting_work(&self) -> Vec<This::Id>;
fn wanted(&self, id: This::Id) -> Wanted;
fn rehearses(&self, id: This::Id) -> bool;
fn begun(&mut self, id: This::Id, holdable: bool);
fn ran_for(&mut self, id: This::Id, elapsed: Duration);
fn refused(&mut self, id: This::Id, detail: &str);
fn performed(
&mut self,
id: This::Id,
destination: PathBuf,
changes: Vec<This::Change>,
);
fn destination_is_taken(&self, id: This::Id) -> bool;
fn entry_phase(&self, id: This::Id) -> Option<TransferPhase>;
}Expand description
Derives what beginning, running, refusing, and finishing one run states to the collection.
A run is attended to by what the request wants of it, and a request wanting nothing is one that was removed, or one whose reader is leaving. Which kind of run a request asks for is something the request already states, so nobody attending to it has to carry that around.
Required Methods§
Sourcefn wanting_work(&self) -> Vec<This::Id>
fn wanting_work(&self) -> Vec<This::Id>
States every request waiting for an interpreter to do what it asks, in collection order.
Sourcefn wanted(&self, id: This::Id) -> Wanted
fn wanted(&self, id: This::Id) -> Wanted
States what one request wants of the run working on its behalf.
Sourcefn rehearses(&self, id: This::Id) -> bool
fn rehearses(&self, id: This::Id) -> bool
States whether one request asks for a rehearsal rather than for the thing itself.
Sourcefn begun(&mut self, id: This::Id, holdable: bool)
fn begun(&mut self, id: This::Id, holdable: bool)
States that a run has begun, as the kind of run the request asks for.
A rehearsal moves nothing and is over when it has said what it would do, so it is never told that it could be held still.
Sourcefn ran_for(&mut self, id: This::Id, elapsed: Duration)
fn ran_for(&mut self, id: This::Id, elapsed: Duration)
States how long one run has been running, when the request counts that.
A rehearsal moves nothing, so how long it took states nothing about a transfer.
Sourcefn refused(&mut self, id: This::Id, detail: &str)
fn refused(&mut self, id: This::Id, detail: &str)
States that one run refused, as the kind of run the request asks for.
Sourcefn performed(
&mut self,
id: This::Id,
destination: PathBuf,
changes: Vec<This::Change>,
)
fn performed( &mut self, id: This::Id, destination: PathBuf, changes: Vec<This::Change>, )
States what one finished run did, as the kind of run the request asks for.
A rehearsal states what it would have changed. A transfer states that it is done, and how much it moved, which is what its changes add up to.
Sourcefn destination_is_taken(&self, id: This::Id) -> bool
fn destination_is_taken(&self, id: This::Id) -> bool
States whether another request is already writing where this one would write.
Two runs writing one path would each publish over the other, and which of them a reader ends up with is decided by whichever finished last. The collection knows both, so it is the collection that states the clash rather than whoever happens to be running them.
Sourcefn entry_phase(&self, id: This::Id) -> Option<TransferPhase>
fn entry_phase(&self, id: This::Id) -> Option<TransferPhase>
Observes the phase one request has reached, while the collection still holds it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<This> ManagerAttentionExt<This> for Thiswhere
This: QueueCatalogAlg + SafeExitAlg + TransferStateAlg + RehearsalStateAlg,
This::Entry: QueueEntryAlg,
This::Change: PlannedChangeAlg,
This::Id: Copy + Eq,
Derives what beginning, running, refusing, and finishing one run states to the collection.
A run is attended to by what the request wants of it, and a request wanting nothing is one that was removed, or one whose reader is leaving. Which kind of run a request asks for is something the request already states, so nobody attending to it has to carry that around.