pub struct UseResolver { /* private fields */ }Expand description
Workspace-wide use resolver
Manages ImportMaps for all modules in the workspace and provides unified name resolution across crate boundaries.
Implementations§
Source§impl UseResolver
impl UseResolver
Sourcepub fn register(&mut self, module_path: SymbolPath, import_map: ImportMap)
pub fn register(&mut self, module_path: SymbolPath, import_map: ImportMap)
Register an ImportMap for a module
Sourcepub fn get(&self, module_path: &SymbolPath) -> Option<&ImportMap>
pub fn get(&self, module_path: &SymbolPath) -> Option<&ImportMap>
Get the ImportMap for a module
Sourcepub fn get_mut(&mut self, module_path: &SymbolPath) -> Option<&mut ImportMap>
pub fn get_mut(&mut self, module_path: &SymbolPath) -> Option<&mut ImportMap>
Get mutable ImportMap for a module
Sourcepub fn resolve(
&self,
module_path: &SymbolPath,
name: &str,
registry: &SymbolRegistry,
) -> Option<SymbolId>
pub fn resolve( &self, module_path: &SymbolPath, name: &str, registry: &SymbolRegistry, ) -> Option<SymbolId>
Resolve a name in a specific module context
Resolution order:
- Module’s ImportMap (direct imports, renames)
- Glob imports from the module
- Walk up the module hierarchy
- Primitives are skipped (handled by caller)
§Arguments
module_path: The module where the name is usedname: The local name to resolveregistry: SymbolRegistry for lookups
§Returns
The SymbolId if found, None otherwise
Sourcepub fn contains(&self, module_path: &SymbolPath) -> bool
pub fn contains(&self, module_path: &SymbolPath) -> bool
Check if there’s an ImportMap for a module
Sourcepub fn iter(&self) -> impl Iterator<Item = (&SymbolPath, &ImportMap)>
pub fn iter(&self) -> impl Iterator<Item = (&SymbolPath, &ImportMap)>
Iterate over all module paths and their ImportMaps
Trait Implementations§
Source§impl Clone for UseResolver
impl Clone for UseResolver
Source§fn clone(&self) -> UseResolver
fn clone(&self) -> UseResolver
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UseResolver
impl Debug for UseResolver
Source§impl Default for UseResolver
impl Default for UseResolver
Source§fn default() -> UseResolver
fn default() -> UseResolver
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for UseResolver
impl RefUnwindSafe for UseResolver
impl Send for UseResolver
impl Sync for UseResolver
impl Unpin for UseResolver
impl UnsafeUnpin for UseResolver
impl UnwindSafe for UseResolver
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