This commit is contained in:
Antonio Scandurra 2023-10-23 11:43:05 +02:00
parent da8919002f
commit 0de4a93ec7
17 changed files with 22689 additions and 11 deletions

View file

@ -152,14 +152,11 @@ impl Executor {
}
}
pub fn block_with_timeout<F, R>(
pub fn block_with_timeout<R>(
&self,
duration: Duration,
future: F,
) -> Result<R, impl Future<Output = R>>
where
F: Future<Output = R> + Send + Sync + 'static,
{
future: impl Future<Output = R>,
) -> Result<R, impl Future<Output = R>> {
let mut future = Box::pin(future);
let timeout = {
let future = &mut future;