How to turn `fn(&mut sqlx::PgConnection) -> Future<Output = Result<Vec<sqlx::postgres::PgRow>, sqlx::Error>>>` into a function parameter

I've tried using Box and Pin around both the result and the function pointer, I tried turning fn to Fn, but every time, the compiler throws an error when I actually pass an handler to the function.

typically, you'll use a generic parameter type if there's unnamable types involed. sometimes, you can use type erase it, but it really depends. more details about the problem is needed.