Struct sindra::scope::Scope [] [src]

pub struct Scope<T> {
    pub item: T,
    pub parent: Option<Rc<RefCell<Scope<T>>>>,
}

General scope object with underlying data structure T.

Scoping is handled by a linked list of Scope objects from the child Scope object (which is the parent of no other scope) to the root (global) Scope object, which has no parent.

Fields

Underlying scoped data structure.

Optional pointer to the parent of this scope.

This should be Some(...) for every Scope object except the root node.

This is maintained as an Rc<RefCell<...>> since a single scope can be the parent of multiple other scopes.

Trait Implementations

impl<Sym: Clone, Tbl> SymbolStore<Sym> for Scope<Tbl> where
    Tbl: SymbolTable<Sym>, 
[src]

[src]

Defines (or updates) a symbol in this symbol store. Returns previous symbol if this identifier has been previously declared. Read more

[src]

Resolves a symbol in this symbol store, or None if no symbol exists for the identifier.

impl<Val: Clone, T> MemoryStore<Val> for Scope<T> where
    T: MemoryTable<Val>, 
[src]

[src]

Sets (or updates) the value in memory for an identifier. Returns the previous value (if exists). Typically, the identifier should already exist in the store, but may not have an existing value. Read more

[src]

Retrieves the value for a particular identifier, if exists.

impl<T: Debug> Debug for Scope<T>
[src]

[src]

Formats the value using the given formatter.

impl<T: Clone> Clone for Scope<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: PartialEq> PartialEq for Scope<T>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<T: Default> Default for Scope<T>
[src]

[src]

Returns the "default value" for a type. Read more