pub struct SideTable<V> { /* private fields */ }Expand description
A (node → payload) side channel: analysis verdicts recorded beside
the HIR rather than written into it (D2 — the HIR stays immutable).
Generic over the payload so a second kind of verdict can ride the same
plumbing instead of a parallel structure being invented for it. Backed by
a BTreeMap so iteration order is deterministic (house rule — never
iterate a HashMap where order affects output); Self::iter is what a
consumer that wants every verdict (e.g. an IDE building an overlay)
walks.
Implementations§
Source§impl<V> SideTable<V>
impl<V> SideTable<V>
Sourcepub fn insert(&mut self, key: NodeKey, value: V) -> Option<V>
pub fn insert(&mut self, key: NodeKey, value: V) -> Option<V>
Record value for the node at key, returning any previous entry.
Sourcepub fn get(&self, key: NodeKey) -> Option<&V>
pub fn get(&self, key: NodeKey) -> Option<&V>
The payload recorded for the node at key, if any.
Sourcepub fn at(&self, file: FileId, range: TextRange) -> Option<&V>
pub fn at(&self, file: FileId, range: TextRange) -> Option<&V>
The payload recorded for the node at range in file, if any — the
convenience spelling for a consumer holding an HIR node rather than a
pre-built NodeKey.
Trait Implementations§
impl<V: Eq> Eq for SideTable<V>
impl<V: PartialEq> StructuralPartialEq for SideTable<V>
Auto Trait Implementations§
impl<V> Freeze for SideTable<V>
impl<V> RefUnwindSafe for SideTable<V>
impl<V> Send for SideTable<V>
impl<V> Sync for SideTable<V>
impl<V> Unpin for SideTable<V>
impl<V> UnsafeUnpin for SideTable<V>
impl<V> UnwindSafe for SideTable<V>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.