Skip to main content

PoolUnit

Trait PoolUnit 

Source
pub trait PoolUnit: Send + 'static {
    type Output: Send + 'static;

    // Required method
    fn execute(self) -> Self::Output;
}
Expand description

One unit of work executed by the storage worker pool.

Units own everything they touch: the pool outlives any single call, so a unit cannot borrow caller state. Return values are handed back to the dispatcher in unit order.

Required Associated Types§

Source

type Output: Send + 'static

The unit’s result, returned positionally by run_units.

Required Methods§

Source

fn execute(self) -> Self::Output

Run the unit to completion on a pool worker thread.

Implementors§