pub struct Scope<'tcx> { /* private fields */ }Expand description
Canonical representation of an item bound in a scope (functions, variables, types, etc.).
Implementations§
Source§impl<'tcx> Scope<'tcx>
impl<'tcx> Scope<'tcx>
pub fn new(owner: HirId) -> Self
pub fn owner(&self) -> HirId
pub fn symbol(&self) -> Option<&'tcx Symbol>
pub fn set_symbol(&self, symbol: Option<&'tcx Symbol>)
pub fn insert(&self, symbol: &'tcx Symbol, interner: &InternPool) -> SymId
pub fn get_id(&self, key: InternedStr) -> Option<SymId>
pub fn lookup_suffix_once(&self, suffix: &[InternedStr]) -> Option<&'tcx Symbol>
pub fn format_compact(&self) -> String
pub fn all_symbols(&self) -> Vec<&'tcx Symbol>
Trait Implementations§
Source§impl<'tcx> ArenaAllocatable<'tcx> for Scope<'tcx>
impl<'tcx> ArenaAllocatable<'tcx> for Scope<'tcx>
fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx Self
Source§impl<'tcx> ArenaAllocatableMut<'tcx> for Scope<'tcx>
impl<'tcx> ArenaAllocatableMut<'tcx> for Scope<'tcx>
fn allocate_on_mut(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut Self
Auto Trait Implementations§
impl<'tcx> !Freeze for Scope<'tcx>
impl<'tcx> !RefUnwindSafe for Scope<'tcx>
impl<'tcx> !Send for Scope<'tcx>
impl<'tcx> !Sync for Scope<'tcx>
impl<'tcx> Unpin for Scope<'tcx>
impl<'tcx> !UnwindSafe for Scope<'tcx>
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> 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