Skip to main content

SessionExt

Trait SessionExt 

Source
pub trait SessionExt<This>{
    // Required methods
    fn attend(
        &mut self,
        running: &mut Vec<Attending<This::Id, This::Run, This::Moment>>,
    );
    fn attend_one(
        &mut self,
        attending: &mut Attending<This::Id, This::Run, This::Moment>,
    ) -> bool;
    fn hold_still(
        &self,
        attending: &mut Attending<This::Id, This::Run, This::Moment>,
    );
    fn let_go(
        &self,
        attending: &mut Attending<This::Id, This::Run, This::Moment>,
    );
    fn running_for(
        &self,
        attending: &Attending<This::Id, This::Run, This::Moment>,
    ) -> Duration;
}
Expand description

Derives one pass of attention from beginning, reading, holding, and ending runs.

Required Methods§

Source

fn attend( &mut self, running: &mut Vec<Attending<This::Id, This::Run, This::Moment>>, )

Attends to every run once, then begins the work nobody has begun yet.

The order is the meaning. Ending comes before beginning, so leaving never races starting; a run is seen to be over before it is read, so everything it wrote before ending is read; and what it said is stated before how it ended, so nothing it said is lost to its ending.

Source

fn attend_one( &mut self, attending: &mut Attending<This::Id, This::Run, This::Moment>, ) -> bool

Attends to one run, and states whether it is still running afterward.

Source

fn hold_still( &self, attending: &mut Attending<This::Id, This::Run, This::Moment>, )

Holds one run still, and remembers when, so held time is not counted as running.

Source

fn let_go(&self, attending: &mut Attending<This::Id, This::Run, This::Moment>)

Lets one held run go, keeping the time it was held still.

Source

fn running_for( &self, attending: &Attending<This::Id, This::Run, This::Moment>, ) -> Duration

States how long one run has been running, not counting the time it was held still.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<This> SessionExt<This> for This

Derives one pass of attention from beginning, reading, holding, and ending runs.