with_timeout

Function with_timeout 

Source
pub async fn with_timeout<F, T>(
    duration: Duration,
    future: F,
) -> Result<T, TimeoutError>
where F: Future<Output = T>,
Expand description

Execute an async operation with timeout using tokio.