pub struct ExtScopeCache { /* private fields */ }Expand description
Memoizes ItemDb::module_defs + ItemDb::module_uses + ItemDb::enum_variants queries across a crate.
Implementations§
Source§impl ExtScopeCache
impl ExtScopeCache
pub fn new() -> Self
Sourcepub fn module_scope(
&mut self,
db: &dyn ItemDb,
mod_def: GlobalDefId,
) -> &ExtModuleScope
pub fn module_scope( &mut self, db: &dyn ItemDb, mod_def: GlobalDefId, ) -> &ExtModuleScope
Returns the exported scope of indexed module mod_def (visibility-filtered to Public
unless same_crate == Some(mod_def.krate)).
Sourcepub fn enum_scope(
&mut self,
db: &dyn ItemDb,
enum_def: GlobalDefId,
) -> &ExtModuleScope
pub fn enum_scope( &mut self, db: &dyn ItemDb, enum_def: GlobalDefId, ) -> &ExtModuleScope
Returns the variant scope of indexed enum enum_def.
Sourcepub fn resolve_prelude_mod(
&mut self,
db: &dyn ItemDb,
tree: &ModuleTree,
) -> Option<GlobalDefId>
pub fn resolve_prelude_mod( &mut self, db: &dyn ItemDb, tree: &ModuleTree, ) -> Option<GlobalDefId>
Resolves the GlobalDefId of the active standard prelude module (std::prelude::rust_2021, etc.).
Trait Implementations§
Source§impl Clone for ExtScopeCache
impl Clone for ExtScopeCache
Source§impl Debug for ExtScopeCache
impl Debug for ExtScopeCache
Auto Trait Implementations§
impl Forget for ExtScopeCache
impl Freeze for ExtScopeCache
impl Move for ExtScopeCache
impl RefUnwindSafe for ExtScopeCache
impl Send for ExtScopeCache
impl Sync for ExtScopeCache
impl Unpin for ExtScopeCache
impl UnsafeUnpin for ExtScopeCache
impl UnwindSafe for ExtScopeCache
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