fn timeout<T, F>(fut: F, msg: &'static str) -> impl Future<Output = Result<T, Error>>
where
    F: Future<Output = Result<T, Error>>,
{
    fut.on_timeout(timeout_duration().after_now(), move || Err(BtError::new(msg).into()))
}
// Wraps a Future inside a timeout that logs a message and resolves to an error on expiration.
Wraps a Future inside a timeout that logs a message and resolves to an error on expiration.
Wraps a Future inside a timeout that logs a message and resolves to an error on expiration .
fn timeout<T, F>(fut: F, msg: &'static str) -> impl Future<Output = Result<T, Error>>
where
    F: Future<Output = Result<T, Error>>,
{
    fut.on_timeout(timeout_duration().after_now(), move || Err(BtError::new(msg).into()))
}
fn timeout < T , F > ( fut : F , msg : & ' static str ) -> impl Future < Output = Result < T , Error > > where F : Future < Output = Result < T , Error > > , { fut . on_timeout ( timeout_duration ( ) . after_now ( ) , move | | Err ( BtError :: new ( msg ) . into ( ) ) ) }
Wraps a Future inside a timeout that logs a message and resolves to an error on expiration.
Wraps a Future inside a timeout that logs a message and resolves to an error on expiration .
fut
F
msg
&'static str
fut
F
msg
&'static str