Struct moore_vhdl::scope2::ScopeData [−][src]
pub struct ScopeData<'t> {
pub parent: Option<&'t ScopeData<'t>>,
pub defs: RefCell<HashMap<ResolvableName, Vec<Spanned<Def2<'t>>>>>,
pub imported_defs: RefCell<HashMap<ResolvableName, Vec<Spanned<Def2<'t>>>>>,
pub imported_scopes: RefCell<HashSet<&'t ScopeData<'t>>>,
}
Expand description
A scope.
Fields
parent: Option<&'t ScopeData<'t>>
The parent scope.
defs: RefCell<HashMap<ResolvableName, Vec<Spanned<Def2<'t>>>>>
The definitions made in this scope.
imported_defs: RefCell<HashMap<ResolvableName, Vec<Spanned<Def2<'t>>>>>
The definitions imported from other scopes.
imported_scopes: RefCell<HashSet<&'t ScopeData<'t>>>
The explicitly imported scopes.
Implementations
pub fn define(
&self,
name: Spanned<ResolvableName>,
def: Def2<'t>,
ctx: &dyn SessionContext
) -> Result<()>
pub fn define(
&self,
name: Spanned<ResolvableName>,
def: Def2<'t>,
ctx: &dyn SessionContext
) -> Result<()>
Define a new name in the scope.
Import a definition into the scope.
Import an entire scope into the scope.
Find a name in this scope.
This only searches this scope and does not proceed to parent or child scopes. Use a dedicated name resolver for that.
Trait Implementations
impl<'t> ScopeSpecificTermContext<'t, &'t ScopeData<'t>, Def2<'t>> for TermContext<AllocContext<'t>, &'t ScopeData<'t>, Def2<'t>>
impl<'t> ScopeSpecificTermContext<'t, &'t ScopeData<'t>, Def2<'t>> for TermContext<AllocContext<'t>, &'t ScopeData<'t>, Def2<'t>>
fn termify_name_in_scope(
&self,
name: Spanned<ResolvableName>,
scope: &'t ScopeData<'t>
) -> Result<Spanned<Term<'t>>>
fn termify_name_in_scope(
&self,
name: Spanned<ResolvableName>,
scope: &'t ScopeData<'t>
) -> Result<Spanned<Term<'t>>>
Map a resolvable name to a term, resolving it within a scope.
Auto Trait Implementations
impl<'t> !RefUnwindSafe for ScopeData<'t>
impl<'t> !UnwindSafe for ScopeData<'t>
Blanket Implementations
Mutably borrows from an owned value. Read more