pub trait StatePool: Pool + Named {
    // Required methods
    fn state(&self) -> PoolState;
    fn change_state(&self, state: PoolState) -> PoolState;

    // Provided methods
    fn running(&self, sync: bool) -> Result<()> { ... }
    fn end(&self) -> Result<()> { ... }
}
Expand description

The StatePool abstraction.

Required Methods§

source

fn state(&self) -> PoolState

Get the state of this pool.

source

fn change_state(&self, state: PoolState) -> PoolState

Change the state of this pool.

Provided Methods§

source

fn running(&self, sync: bool) -> Result<()>

created -> running

Errors

if change state fails.

source

fn end(&self) -> Result<()>

running -> stopping stopping -> stopped

Errors

if change state fails.

Implementors§

source§

impl StatePool for CoroutinePoolImpl<'_>

source§

impl<'p, HasCoroutinePoolImpl: HasCoroutinePool<'p> + Debug + Named> StatePool for HasCoroutinePoolImpl