pub struct CompilationScope {
pub precompiler_data: Option<PrecompilerData>,
pub once: bool,
pub was_used: bool,
/* private fields */
}Fields§
§precompiler_data: Option<PrecompilerData>optional precompiler data, only on the root scope
once: boolIf once is true, the scope can only be used for compilation once. E.g. for a REPL, this needs to be false, so that the scope can be reused
was_used: boolIf was_used is true, the scope has been used for compilation and should not be reused if once is true.
Implementations§
Source§impl CompilationScope
impl CompilationScope
pub fn new(once: bool) -> CompilationScope
pub fn new_with_external_parent_scope( parent_context: CompilationScope, ) -> CompilationScope
pub fn has_external_parent_scope(&self) -> bool
pub fn register_variable_slot(&mut self, variable: Variable)
pub fn get_next_virtual_slot(&mut self) -> u32
pub fn resolve_variable_name_to_virtual_slot( &self, name: &str, ) -> Option<(VirtualSlot, VariableType, VariableMutType)>
Sourcepub fn push(self) -> CompilationScope
pub fn push(self) -> CompilationScope
Creates a new CompileScope that is a child of the current scope.
Sourcepub fn pop(self) -> Option<(CompilationScope, Vec<VirtualSlot>)>
pub fn pop(self) -> Option<(CompilationScope, Vec<VirtualSlot>)>
Drops the current scope and returns to the parent scope and a list of all slot addresses that should be dropped.
pub fn pop_external(self) -> Option<CompilationScope>
Trait Implementations§
Source§impl Clone for CompilationScope
impl Clone for CompilationScope
Source§fn clone(&self) -> CompilationScope
fn clone(&self) -> CompilationScope
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompilationScope
impl Debug for CompilationScope
Auto Trait Implementations§
impl !Freeze for CompilationScope
impl !RefUnwindSafe for CompilationScope
impl !Send for CompilationScope
impl !Sync for CompilationScope
impl Unpin for CompilationScope
impl !UnwindSafe for CompilationScope
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more