Skip to main content

ManagerAttentionExt

Trait ManagerAttentionExt 

Source
pub trait ManagerAttentionExt<This>{
    // 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§

Source

fn wanting_work(&self) -> Vec<This::Id>

States every request waiting for an interpreter to do what it asks, in collection order.

Source

fn wanted(&self, id: This::Id) -> Wanted

States what one request wants of the run working on its behalf.

Source

fn rehearses(&self, id: This::Id) -> bool

States whether one request asks for a rehearsal rather than for the thing itself.

Source

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.

Source

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.

Source

fn refused(&mut self, id: This::Id, detail: &str)

States that one run refused, as the kind of run the request asks for.

Source

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.

Source

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.

Source

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§

Source§

impl<This> ManagerAttentionExt<This> for This

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.