struct ScopeChain<'scope, 'db> {
kind: ScopeChainKind<'scope, 'db>,
next: Option<Box<ScopeChain<'scope, 'db>>>,
}Expand description
A link in the scope resolution chain. We first attempt to resolve an identifier
in the associated ScopeChainKind and, if nothing is found, proceed to
the next link.
Fields§
§kind: ScopeChainKind<'scope, 'db>Kind of this link.
next: Option<Box<ScopeChain<'scope, 'db>>>Next link in the chain. Earlier links shadow later links.
Implementations§
Source§impl<'scope, 'db> ScopeChain<'scope, 'db>
impl<'scope, 'db> ScopeChain<'scope, 'db>
Sourcefn primitives() -> Self
fn primitives() -> Self
Creates the base of the name resolution chain (primitive types).
Sourcepub fn iter(&self) -> impl Iterator<Item = &ScopeChain<'scope, 'db>>
pub fn iter(&self) -> impl Iterator<Item = &ScopeChain<'scope, 'db>>
Walks the chain, starting with the innermost links.
fn resolve_name( &self, db: &'db dyn Db, id: Identifier<'db>, ) -> Option<NameResolution<'db>>
Sourcefn internal_module_item(
&self,
_db: &'db dyn Db,
sym: impl ScopeTreeNode<'db> + Into<NameResolutionSym<'db>> + Copy,
) -> NameResolution<'db>
fn internal_module_item( &self, _db: &'db dyn Db, sym: impl ScopeTreeNode<'db> + Into<NameResolutionSym<'db>> + Copy, ) -> NameResolution<'db>
Resolve an identifier like x that we mapped to some item in a module.
fn binds_symbol(&self, _db: &'db dyn Db, sym: SymVariable<'db>) -> bool
Trait Implementations§
Source§impl<'scope, 'db> Clone for ScopeChain<'scope, 'db>
impl<'scope, 'db> Clone for ScopeChain<'scope, 'db>
Source§fn clone(&self) -> ScopeChain<'scope, 'db>
fn clone(&self) -> ScopeChain<'scope, 'db>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'scope, 'db> Debug for ScopeChain<'scope, 'db>
impl<'scope, 'db> Debug for ScopeChain<'scope, 'db>
Source§impl<'scope, 'db> PartialEq for ScopeChain<'scope, 'db>
impl<'scope, 'db> PartialEq for ScopeChain<'scope, 'db>
impl<'scope, 'db> Eq for ScopeChain<'scope, 'db>
impl<'scope, 'db> StructuralPartialEq for ScopeChain<'scope, 'db>
Auto Trait Implementations§
impl<'scope, 'db> Freeze for ScopeChain<'scope, 'db>
impl<'scope, 'db> !RefUnwindSafe for ScopeChain<'scope, 'db>
impl<'scope, 'db> Send for ScopeChain<'scope, 'db>
impl<'scope, 'db> Sync for ScopeChain<'scope, 'db>
impl<'scope, 'db> Unpin for ScopeChain<'scope, 'db>
impl<'scope, 'db> UnsafeUnpin for ScopeChain<'scope, 'db>
impl<'scope, 'db> !UnwindSafe for ScopeChain<'scope, 'db>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more