Using Rust dereferencing operators &* vs * with Self?
问题 I want to write an LRU Cache with a memory size limitation rather than the "number of objects" limitation in std. After trying to figure it out for myself, I cheated and looked at an existing implementation, and I almost understand it, but this stops me: struct KeyRef<K> { k: *const K, } impl<K: Hash> Hash for LruKeyRef<K> { fn hash<H: Hasher>(&self, state: &mut H) { unsafe { (*self.k).hash(state) } } } impl<K: PartialEq> PartialEq for LruKeyRef<K> { fn eq(&self, other: &LruKeyRef<K>) -> bool