pub async fn cache_res<D, F, Ft>(name: &str, f: F, force_run: bool) -> D
where
    // By making this `Any`, we can downcast it to manage errors intuitively
    D: Serialize + for<'de> Deserialize<'de> + Any,
    F: Fn() -> Ft,
    Ft: Future<Output = D>,
{
    let f_res = || async { Ok::<D, Infallible>(f().await) };
    // This can't fail, we just invented an error type for an infallible function
    cache_fallible_res(name, f_res, force_run).await.unwrap()
}
Runs the given function once and then caches the result to the filesystem
for future execution. Think of this as filesystem-level memoizing. In
future, this will be broken out into its own crate and wrapped by Perseus.
The second parameter to this allows forcing the function to re-fetch data
every time, which is useful if you want to revalidate data or test
your fetching logic again. Note that a change to the logic will not trigger
a reload unless you make it do so. For this reason, it's recommended to only
use this wrapper once you've tested your fetching logic.

When running automated tests, you may wish to set `force_run` to the result
of an environment variable check that you'll use when testing.

# Panics
If this filesystem operations fail, this function will panic. It can't
return a graceful error since it's expected to return the type you
requested.
packages/perseus/src/utils/cache_res.rs