pub struct Scope {
pub typ: ScopeType,
/* private fields */
}
Fields§
§typ: ScopeType
Implementations§
Source§impl Scope
impl Scope
pub fn new(typ: ScopeType) -> Self
pub fn new_child(&self, typ: ScopeType) -> Self
pub fn add_symbol(&self, name: String) -> bool
pub fn has_symbol(&self, name: &str) -> bool
pub fn get_symbol(&self, name: &str) -> Symbol
pub fn declaration_is_boxed(&self, symbol: Symbol) -> bool
pub fn captures_box_of(&self, symbol: Symbol) -> bool
pub fn borrow(&self) -> RefMut<'_, ScopeData>
pub fn borrow_mut(&self) -> RefMut<'_, ScopeData>
pub fn find_symbol_declaration(&self, name: &str) -> Option<(Scope, Symbol)>
pub fn find_nearest_scope<P: Fn(ScopeType) -> bool>( &self, pred: P, ) -> Option<Scope>
pub fn find_nearest_closure(&self) -> Option<Scope>
pub fn parent(&self) -> Option<Scope>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scope
impl !RefUnwindSafe for Scope
impl !Send for Scope
impl !Sync for Scope
impl Unpin for Scope
impl !UnwindSafe for Scope
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