Skip to main content

ExtScopeCache

Struct ExtScopeCache 

Source
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

Source

pub fn new() -> Self

Source

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)).

Source

pub fn enum_scope( &mut self, db: &dyn ItemDb, enum_def: GlobalDefId, ) -> &ExtModuleScope

Returns the variant scope of indexed enum enum_def.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExtScopeCache

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExtScopeCache

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for ExtScopeCache

§

impl Freeze for ExtScopeCache
where *const u8 is !null: Freeze, PhantomData<(GlobalDefId, ExtModuleScope)>: Freeze, PhantomData<GlobalDefId>: Freeze, PhantomData<(ImplTargetKey, Box<[CachedAssocItem]>)>: Freeze, PhantomData<(GlobalDefId, Box<[CachedAssocItem]>)>: Freeze, PhantomData<(GlobalDefId, Box<[GlobalDefId]>)>: Freeze, PhantomData<(ImplTargetKey, Box<[CachedTraitImpl]>)>: Freeze, PhantomData<(GlobalDefId, Box<[CachedTraitImpl]>)>: Freeze, PhantomData<(u64, CachedModTraitScope)>: Freeze,

§

impl Move for ExtScopeCache

§

impl RefUnwindSafe for ExtScopeCache

§

impl Send for ExtScopeCache
where RawTable<(GlobalDefId, ExtModuleScope)>: Send, RawVecInner: Send, RawTable<(ImplTargetKey, Box<[CachedAssocItem]>)>: Send, RawTable<(GlobalDefId, Box<[CachedAssocItem]>)>: Send, RawTable<(GlobalDefId, Box<[GlobalDefId]>)>: Send, RawTable<(ImplTargetKey, Box<[CachedTraitImpl]>)>: Send, RawTable<(GlobalDefId, Box<[CachedTraitImpl]>)>: Send, RawTable<(u64, CachedModTraitScope)>: Send,

§

impl Sync for ExtScopeCache
where RawTable<(GlobalDefId, ExtModuleScope)>: Sync, RawVecInner: Sync, RawTable<(ImplTargetKey, Box<[CachedAssocItem]>)>: Sync, RawTable<(GlobalDefId, Box<[CachedAssocItem]>)>: Sync, RawTable<(GlobalDefId, Box<[GlobalDefId]>)>: Sync, RawTable<(ImplTargetKey, Box<[CachedTraitImpl]>)>: Sync, RawTable<(GlobalDefId, Box<[CachedTraitImpl]>)>: Sync, RawTable<(u64, CachedModTraitScope)>: Sync,

§

impl Unpin for ExtScopeCache
where *const u8 is !null: Unpin, Box<str>: Unpin, Box<[CachedAssocItem]>: Unpin, Box<[GlobalDefId]>: Unpin, Box<[CachedTraitImpl]>: Unpin, Box<[(GlobalDefId, NsMask)]>: Unpin,

§

impl UnsafeUnpin for ExtScopeCache

§

impl UnwindSafe for ExtScopeCache
where HashMap<GlobalDefId, ExtModuleScope>: UnwindSafe, RawVecInner: UnwindSafe, HashMap<ImplTargetKey, Box<[CachedAssocItem]>>: UnwindSafe, HashMap<GlobalDefId, Box<[CachedAssocItem]>>: UnwindSafe, HashMap<GlobalDefId, Box<[GlobalDefId]>>: UnwindSafe, HashMap<ImplTargetKey, Box<[CachedTraitImpl]>>: UnwindSafe, HashMap<GlobalDefId, Box<[CachedTraitImpl]>>: UnwindSafe, HashMap<u64, CachedModTraitScope>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.