pub struct ResolveTable { /* private fields */ }Expand description
A parse-time resolution side-table for one parsed source tree.
Keyed by the reference ident node’s byte offset (text_range().start())
within this parse — mirroring how sui-eval’s intern_cached keys its
per-(source_id, offset) ident cache (value.rs). The consumer stashes
one table per parsed source (the source_id disambiguation lives on the
consumer side, exactly as it does for the ident cache). A lookup for an
unrecorded offset returns Resolution::Dynamic — the fail-safe path.
Implementations§
Source§impl ResolveTable
impl ResolveTable
Sourcepub fn new() -> Self
pub fn new() -> Self
An empty table — every lookup returns Resolution::Dynamic.
Sourcepub fn get(&self, text_offset: u32) -> Resolution
pub fn get(&self, text_offset: u32) -> Resolution
Resolution recorded for a reference at text_offset. An unrecorded
offset is Resolution::Dynamic (the fail-safe fallback).
Sourcepub fn entries(&self) -> impl Iterator<Item = (u32, Resolution)> + '_
pub fn entries(&self) -> impl Iterator<Item = (u32, Resolution)> + '_
Iterate the recorded (text_offset, resolution) entries. Only
Lexical entries are stored, so this yields exactly the
shortcut-eligible references. Consumers merge these into their own
per-(source_id, offset) table.
Trait Implementations§
Source§impl Clone for ResolveTable
impl Clone for ResolveTable
Source§fn clone(&self) -> ResolveTable
fn clone(&self) -> ResolveTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more