(duration: Duration, future: F)
| 36 | use tokio::time::timeout; |
| 37 | |
| 38 | pub async fn with_timeout<T, F>(duration: Duration, future: F) -> Option<T> |
| 39 | where |
| 40 | F: std::future::Future<Output = T>, |
| 41 | { |
| 42 | timeout(duration, future).await.ok() |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | pub mod defer { |
nothing calls this directly
no outgoing calls
no test coverage detected