Move level into GlobalRuntimeState.

This commit is contained in:
Stephen Chung
2022-11-08 21:28:20 +08:00
parent 5bae4d8a19
commit e93923b3b6
21 changed files with 409 additions and 493 deletions

View File

@@ -4,7 +4,7 @@ use crate::func::RegisterNativeFunction;
use crate::types::dynamic::Variant;
use crate::{
Dynamic, Engine, EvalAltResult, FnPtr, Identifier, ImmutableString, NativeCallContext,
Position, RhaiResult, RhaiResultOf, Scope, AST,
Position, RhaiResult, RhaiResultOf, Scope, SharedModule, AST,
};
#[cfg(feature = "no_std")]
use std::prelude::v1::*;
@@ -354,6 +354,26 @@ impl Dynamic {
}
impl NativeCallContext<'_> {
/// Create a new [`NativeCallContext`].
///
/// # Unimplemented
///
/// This method is deprecated. It is no longer implemented and always panics.
///
/// Use [`FnPtr::call`] to call a function pointer directly.
///
/// This method will be removed in the next major version.
#[deprecated(
since = "1.3.0",
note = "use `FnPtr::call` to call a function pointer directly."
)]
#[inline(always)]
#[must_use]
#[allow(unused_variables)]
pub fn new(engine: &Engine, fn_name: &str, lib: &[SharedModule]) -> Self {
unimplemented!("`NativeCallContext::new` is deprecated");
}
/// Call a function inside the call context.
///
/// # Deprecated