Struct rhai::NativeCallContext [−][src]
pub struct NativeCallContext<'a> { /* fields omitted */ }
Expand description
Context of a native Rust function call.
Implementations
impl<'a> NativeCallContext<'a>
[src]
impl<'a> NativeCallContext<'a>
[src]pub fn new(engine: &'a Engine, fn_name: &'a str, lib: &'a [&Module]) -> Self
[src]
pub fn new(engine: &'a Engine, fn_name: &'a str, lib: &'a [&Module]) -> Self
[src]Create a new NativeCallContext
.
pub fn new_with_all_fields(
engine: &'a Engine,
fn_name: &'a str,
source: &'a Option<&str>,
imports: &'a Imports,
lib: &'a [&Module]
) -> Self
[src]
pub fn new_with_all_fields(
engine: &'a Engine,
fn_name: &'a str,
source: &'a Option<&str>,
imports: &'a Imports,
lib: &'a [&Module]
) -> Self
[src](INTERNALS) Create a new NativeCallContext
.
Exported under the internals
feature only.
Not available under no_module
.
pub fn iter_imports(&self) -> impl Iterator<Item = (&str, &Module)>
[src]
pub fn iter_imports(&self) -> impl Iterator<Item = (&str, &Module)>
[src]Get an iterator over the current set of modules imported via import
statements.
Not available under no_module
.
pub fn imports(&self) -> Option<&Imports>
[src]
pub fn imports(&self) -> Option<&Imports>
[src](INTERNALS) The current set of modules imported via import
statements.
Exported under the internals
feature only.
Not available under no_module
.
pub fn iter_namespaces(&self) -> impl Iterator<Item = &Module>
[src]
pub fn iter_namespaces(&self) -> impl Iterator<Item = &Module>
[src]Get an iterator over the namespaces containing definitions of all script-defined functions.
pub fn namespaces(&self) -> &[&Module]
[src]
pub fn namespaces(&self) -> &[&Module]
[src](INTERNALS) The current set of namespaces containing definitions of all script-defined functions.
Exported under the internals
feature only.
pub fn call_fn_dynamic_raw(
&self,
fn_name: impl AsRef<str>,
is_method: bool,
args: &mut [&mut Dynamic]
) -> Result<Dynamic, Box<EvalAltResult>>
[src]
pub fn call_fn_dynamic_raw(
&self,
fn_name: impl AsRef<str>,
is_method: bool,
args: &mut [&mut Dynamic]
) -> Result<Dynamic, Box<EvalAltResult>>
[src]Call a function inside the call context.
WARNING
All arguments may be consumed, meaning that they may be replaced by ()
.
This is to avoid unnecessarily cloning the arguments.
Do not use the arguments after this call. If they are needed afterwards, clone them before calling this function.
If is_method
is true
, the first argument is assumed to be passed
by reference and is not consumed.
Trait Implementations
impl<'a> Debug for NativeCallContext<'a>
[src]
impl<'a> Debug for NativeCallContext<'a>
[src]