[][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.

Methods

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> 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.

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

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

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

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

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

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl<'t> !Send for ScopeData<'t>

impl<'t> !Sync for ScopeData<'t>

Blanket Implementations

impl<T> From for T
[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.