pub struct BinderScopes<'a> { /* private fields */ }Implementations§
Source§impl<'a> BinderScopes<'a>
impl<'a> BinderScopes<'a>
pub fn new(unit: CompileUnit<'a>, globals: &'a Scope<'a>) -> Self
pub fn top(&self) -> &'a Scope<'a>
pub fn unit(&self) -> CompileUnit<'a>
pub fn interner(&self) -> &InternPool
pub fn scopes(&self) -> &ScopeStack<'a>
pub fn scopes_mut(&mut self) -> &mut ScopeStack<'a>
Sourcepub fn scope_depth(&self) -> usize
pub fn scope_depth(&self) -> usize
Gets the current depth of the scope stack.
- 0 means no scope has been pushed yet
- 1 means global scope is active
- 2+ means nested scopes are active
Sourcepub fn push_scope(&mut self, id: ScopeId)
pub fn push_scope(&mut self, id: ScopeId)
Pushes a scope onto the stack by looking it up from the compilation unit.
Sourcepub fn push_scope_recursive(&mut self, id: ScopeId)
pub fn push_scope_recursive(&mut self, id: ScopeId)
Pushes a scope recursively with all its parent scopes.
Sourcepub fn push_scope_node(&mut self, sn: &'a HirScope<'a>)
pub fn push_scope_node(&mut self, sn: &'a HirScope<'a>)
Pushes the scope represented by a HirScope node.
pub fn lookup_globals( &self, name: &str, kind_filters: SymKindSet, ) -> Option<Vec<&'a Symbol>>
pub fn lookup_global( &self, name: &str, kind_filters: SymKindSet, ) -> Option<&'a Symbol>
Sourcepub fn lookup_symbols(
&self,
name: &str,
kind_filters: SymKindSet,
) -> Option<Vec<&'a Symbol>>
pub fn lookup_symbols( &self, name: &str, kind_filters: SymKindSet, ) -> Option<Vec<&'a Symbol>>
Lookup symbols by name with options
pub fn lookup_symbol( &self, name: &str, kind_filters: SymKindSet, ) -> Option<&'a Symbol>
Sourcepub fn lookup_member_symbols(
&self,
obj_type_symbol: &'a Symbol,
member_name: &str,
kind_filters: SymKindSet,
) -> Option<&'a Symbol>
pub fn lookup_member_symbols( &self, obj_type_symbol: &'a Symbol, member_name: &str, kind_filters: SymKindSet, ) -> Option<&'a Symbol>
Look up a member symbol in a type’s scope.
Sourcepub fn lookup_member_symbol(
&self,
obj_type_symbol: &'a Symbol,
member_name: &str,
kind_filter: Option<SymKind>,
) -> Option<&'a Symbol>
pub fn lookup_member_symbol( &self, obj_type_symbol: &'a Symbol, member_name: &str, kind_filter: Option<SymKind>, ) -> Option<&'a Symbol>
Look up a member symbol in a type’s scope.
Sourcepub fn lookup_qualified(
&self,
qualified_name: &[&str],
kind_filters: SymKindSet,
) -> Option<Vec<&'a Symbol>>
pub fn lookup_qualified( &self, qualified_name: &[&str], kind_filters: SymKindSet, ) -> Option<Vec<&'a Symbol>>
Look up a qualified path (e.g., foo::Bar::baz) with optional kind filters.
Sourcepub fn lookup_qualified_symbol(
&self,
qualified_name: &[&str],
kind_filters: SymKindSet,
) -> Option<&'a Symbol>
pub fn lookup_qualified_symbol( &self, qualified_name: &[&str], kind_filters: SymKindSet, ) -> Option<&'a Symbol>
Look up a qualified path and apply same-crate preference for multi-crate scenarios.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for BinderScopes<'a>
impl<'a> !RefUnwindSafe for BinderScopes<'a>
impl<'a> Send for BinderScopes<'a>
impl<'a> Sync for BinderScopes<'a>
impl<'a> Unpin for BinderScopes<'a>
impl<'a> !UnwindSafe for BinderScopes<'a>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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