pub async fn attempt_database_connection<F, Fut, T, U>(fut: F) -> Twhere
    F: FnMut() -> Fut,
    Fut: Future<Output = Result<T, U>>,
    U: Error,
Expand description

Attempt to connect to a database, with retries.

This function takes a closure with a database connection function as an argument; said function should return a future that resolves to a final value of type Result<T, sqlx::Error>.