pub struct IdCache<V> { /* private fields */ }Expand description
A cache keyed on node identity, dense: Vec<Option<V>> indexed by the id, so a lookup is
a bounds check and NOT a hash.
This is the other half of hash-consing. Sharing makes a repeated subterm one node; a cache keyed on that node makes it checked ONCE.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<V> Freeze for IdCache<V>
impl<V> RefUnwindSafe for IdCache<V>where
V: RefUnwindSafe,
impl<V> Send for IdCache<V>where
V: Send,
impl<V> Sync for IdCache<V>where
V: Sync,
impl<V> Unpin for IdCache<V>where
V: Unpin,
impl<V> UnsafeUnpin for IdCache<V>
impl<V> UnwindSafe for IdCache<V>where
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more