pub trait VirtualTaskManagerExt {
    // Required methods
    fn spawn_and_block_on<A>(
        &self,
        task: impl Future<Output = A> + Send + 'static,
    ) -> Result<A, Error>
       where A: Send + 'static;
    fn spawn_await<O, F>(
        &self,
        f: F,
    ) -> Box<dyn Future<Output = Result<O, Box<dyn Error>>> + Unpin + Send + 'static>
       where O: Send + 'static,
             F: FnOnce() -> O + Send + 'static;
}
Expand description

Generic utility methods for VirtualTaskManager

Required Methods§

source

fn spawn_and_block_on<A>( &self, task: impl Future<Output = A> + Send + 'static, ) -> Result<A, Error>
where A: Send + 'static,

Runs the work in the background via the task managers shared background threads while blocking the current execution until it finishs

source

fn spawn_await<O, F>( &self, f: F, ) -> Box<dyn Future<Output = Result<O, Box<dyn Error>>> + Unpin + Send + 'static>
where O: Send + 'static, F: FnOnce() -> O + Send + 'static,

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<D, T> VirtualTaskManagerExt for D
where D: Deref<Target = T>, T: VirtualTaskManager + ?Sized,