pub struct TypeScope { /* private fields */ }
Implementations§
Source§impl TypeScope
impl TypeScope
Sourcepub fn find(&self, name: &str) -> Option<VariableType>
pub fn find(&self, name: &str) -> Option<VariableType>
Find a value/reference in this scope by iterating over the scopes from back to front.
pub fn is_mutable(&self, name: &str) -> bool
Sourcepub fn contains_in_current_scope(&self, name: &str) -> bool
pub fn contains_in_current_scope(&self, name: &str) -> bool
Check, if a variable is present in the current scope.
Sourcepub fn set(&mut self, name: &str, value: VariableType, is_mutable: bool)
pub fn set(&mut self, name: &str, value: VariableType, is_mutable: bool)
Create a new variable on the current scope.
Sourcepub fn update(
&mut self,
name: &str,
value: VariableType,
position: &(String, usize, usize),
) -> Result<(), TypeError>
pub fn update( &mut self, name: &str, value: VariableType, position: &(String, usize, usize), ) -> Result<(), TypeError>
Update a value of an already present variable.
pub fn flatten(&self) -> HashMap<String, Variable>
Trait Implementations§
impl Eq for TypeScope
Auto Trait Implementations§
impl Freeze for TypeScope
impl !RefUnwindSafe for TypeScope
impl !Send for TypeScope
impl !Sync for TypeScope
impl Unpin for TypeScope
impl !UnwindSafe for TypeScope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more