Design a collection with compile-time reference stability in Rust (2)
在上一篇文章中,我们设计了一个允许同时持有多个不可变引用的 LruCache。唯一的问题是,为了足够安全,API 不太易用。这篇文章完美地解决了问题。 1234567891011new_lru_cache(|mut perm, mut cache| { cache.put("a", "b".to_string(), &mut perm