[][src]Struct moore_vhdl::scope2::ScopeData

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>>>,
}

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

impl<'t> ScopeData<'t>[src]

pub fn root() -> ScopeData<'t>[src]

Create a new root scope.

pub fn new(parent: &'t ScopeData<'t>) -> ScopeData<'t>[src]

Create a new scope.

pub fn define(
    &self,
    name: Spanned<ResolvableName>,
    def: Def2<'t>,
    ctx: &dyn SessionContext
) -> Result<()>
[src]

Define a new name in the scope.

pub fn import_def(
    &self,
    name: ResolvableName,
    def: Spanned<Def2<'t>>
) -> Result<()>
[src]

Import a definition into the scope.

pub fn import_scope(&self, scope: &'t ScopeData<'t>) -> Result<()>[src]

Import an entire scope into the scope.

pub fn resolve(
    &self,
    name: ResolvableName,
    recur: bool
) -> Vec<Spanned<Def2<'t>>>
[src]

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<'a, 't> Alloc<'a, 'a, ScopeData<'t>> for Arenas2<'t> where
    't: 'a, 
[src]

impl<'t> Clone for ScopeData<'t>[src]

impl<'t> Debug for ScopeData<'t>[src]

impl<'t> Eq for &'t ScopeData<'t>[src]

impl<'t> Hash for &'t ScopeData<'t>[src]

impl<'t> PartialEq<&'t ScopeData<'t>> for &'t ScopeData<'t>[src]

impl<'t> ScopeSpecificTermContext<'t, &'t ScopeData<'t>, Def2<'t>> for TermContext<AllocContext<'t>, &'t ScopeData<'t>, Def2<'t>>[src]

fn termify_name_in_scope(
    &self,
    name: Spanned<ResolvableName>,
    scope: &'t ScopeData<'t>
) -> Result<Spanned<Term<'t>>>
[src]

Map a resolvable name to a term, resolving it within a scope.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.