Struct moore_vhdl::scope2::ScopeData
source · [−]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
sourceimpl<'t> ScopeData<'t>
impl<'t> ScopeData<'t>
sourcepub 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.
sourcepub fn import_def(
&self,
name: ResolvableName,
def: Spanned<Def2<'t>>
) -> Result<()>
pub fn import_def(
&self,
name: ResolvableName,
def: Spanned<Def2<'t>>
) -> Result<()>
Import a definition into the scope.
sourcepub fn import_scope(&self, scope: &'t ScopeData<'t>) -> Result<()>
pub fn import_scope(&self, scope: &'t ScopeData<'t>) -> Result<()>
Import an entire scope into the scope.
sourcepub fn resolve(
&self,
name: ResolvableName,
recur: bool
) -> Vec<Spanned<Def2<'t>>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn resolve(
&self,
name: ResolvableName,
recur: bool
) -> Vec<Spanned<Def2<'t>>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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
sourceimpl<'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>>
sourcefn 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.
fn maybe_selectable_scope(&self, term: &Term<'t>) -> Option<&'t ScopeData<'t>>
impl<'t> Eq for &'t ScopeData<'t>
Auto Trait Implementations
impl<'t> !RefUnwindSafe for ScopeData<'t>
impl<'t> !Send for ScopeData<'t>
impl<'t> !Sync for ScopeData<'t>
impl<'t> Unpin for ScopeData<'t>
impl<'t> !UnwindSafe for ScopeData<'t>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more