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§
sourcefn spawn_and_block_on<A>(
&self,
task: impl Future<Output = A> + Send + 'static,
) -> Result<A, Error>where
A: Send + 'static,
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
fn spawn_await<O, F>( &self, f: F, ) -> Box<dyn Future<Output = Result<O, Box<dyn Error>>> + Unpin + Send + 'static>
Object Safety§
This trait is not object safe.