Struct rhai::EvalState [−][src]
pub struct EvalState { pub source: Option<Identifier>, pub always_search: bool, pub scope_level: usize, pub operations: u64, pub modules: usize, pub resolver: Option<Shared<StaticModuleResolver>>, // some fields omitted }
Expand description
(INTERNALS) A type that holds all the current states of the Engine
.
Exported under the internals
feature only.
Volatile Data Structure
This type is volatile and may change.
Fields
source: Option<Identifier>
Source of the current context.
always_search: bool
Normally, access to variables are parsed with a relative offset into the scope to avoid a lookup.
In some situation, e.g. after running an eval
statement, subsequent offsets become mis-aligned.
When that happens, this flag is turned on to force a scope lookup by name.
scope_level: usize
Level of the current scope. The global (root) level is zero, a new block (or function call) is one level higher, and so on.
operations: u64
Number of operations performed.
modules: usize
Number of modules loaded.
resolver: Option<Shared<StaticModuleResolver>>
Embedded module resolver.
Implementations
impl State
[src]
impl State
[src]pub fn fn_resolution_cache_mut(
&mut self
) -> &mut BTreeMap<u64, Option<Box<FnResolutionCacheEntry>>>
[src]
pub fn fn_resolution_cache_mut(
&mut self
) -> &mut BTreeMap<u64, Option<Box<FnResolutionCacheEntry>>>
[src]Get a mutable reference to the current function resolution cache.
pub fn push_fn_resolution_cache(&mut self)
[src]
pub fn push_fn_resolution_cache(&mut self)
[src]Push an empty function resolution cache onto the stack and make it current.
pub fn pop_fn_resolution_cache(&mut self)
[src]
pub fn pop_fn_resolution_cache(&mut self)
[src]Remove the current function resolution cache from the stack and make the last one current.
Panics
Panics if there are no more function resolution cache in the stack.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for State
impl !Send for State
impl !Sync for State
impl Unpin for State
impl !UnwindSafe for State
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more