1 2 3 4 5 6 7 8 9 10 11 12 13 14
use cached::macros::cached; #[derive(Clone)] struct Val; impl cached::Expires for Val { fn is_expired(&self) -> bool { false } } #[cached(expires = true, cache_err = true)] fn my_fn(x: u32) -> Result<Val, String> { Ok(Val) } fn main() {}