[−][src]Struct zypo_lib::parser::scope::Scope
Structure for storing an AST node as a hashmap node inside of a vector.
To use this structure, a node type has to implament Hash and Eq (similar to PartialEq).
Methods
impl<K: Hash + Eq, V> Scope<K, V>[src]
pub fn new() -> Self[src]
Creates a new, empty scope.
pub fn enter_scope(&mut self)[src]
Creates a new scope at top of stack, acting as a new scope.
pub fn leave_scope(&mut self)[src]
Leaves the scope by popping the top value of the HashMap vector stack.
pub fn get(&self, item: &K) -> Option<&V>[src]
Scans bottom-up from the scope stack to find the specified item
argument. This method recurses down the branches of the stack until it
finds the item (linear search).
pub fn insert(&mut self, key: K, value: V) -> Option<V>[src]
Inserts a new item into the stack.
NOTE: This will panic if a fatal error occurs if inserting into a broken stack.
pub fn depth(&self) -> usize[src]
Gets the depth of the entire Scope data structure.
Auto Trait Implementations
impl<K, V> Send for Scope<K, V> where
K: Send,
V: Send,
K: Send,
V: Send,
impl<K, V> Sync for Scope<K, V> where
K: Sync,
V: Sync,
K: Sync,
V: Sync,
impl<K, V> Unpin for Scope<K, V> where
K: Unpin,
V: Unpin,
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for Scope<K, V> where
K: UnwindSafe,
V: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
impl<K, V> RefUnwindSafe for Scope<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,