matrix_sdk_base::timeout

Function timeout

Source
pub async fn timeout<F, T>(
    future: F,
    duration: Duration,
) -> Result<T, ElapsedError>
where F: Future<Output = T> + Unpin,
Expand description

Wait for future to be completed. future needs to return a Result.

If the given timeout has elapsed the method will stop waiting and return an error.