Function perseus::cache_fallible_res
source · [−]pub async fn cache_fallible_res<D, E, F, Ft>(
name: &str,
f: F,
force_run: bool
) -> Result<D, E> where
D: Serialize + for<'de> Deserialize<'de>,
E: Error,
F: Fn() -> Ft,
Ft: Future<Output = Result<D, E>>,
Expand description
Same as cache_res
, but takes a function that returns a Result
, allowing you to use ?
and the like inside your logic.