Add custom state.
This commit is contained in:
@@ -60,6 +60,18 @@ impl<'s, 'ps, 'm, 'pm, 'pt> EvalContext<'_, 's, 'ps, 'm, 'pm, '_, '_, 'pt> {
|
||||
pub fn iter_imports(&self) -> impl Iterator<Item = (&str, &Module)> {
|
||||
self.global.iter_imports()
|
||||
}
|
||||
/// Custom state kept in a [`Dynamic`].
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub const fn tag(&self) -> &Dynamic {
|
||||
&self.global.tag
|
||||
}
|
||||
/// Mutable reference to the custom state kept in a [`Dynamic`].
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn tag_mut(&mut self) -> &mut Dynamic {
|
||||
&mut self.global.tag
|
||||
}
|
||||
/// _(internals)_ The current [`GlobalRuntimeState`].
|
||||
/// Exported under the `internals` feature only.
|
||||
#[cfg(feature = "internals")]
|
||||
|
Reference in New Issue
Block a user