[−][src]Struct rhai::NativeCallContext
Context of a native Rust function call.
Implementations
impl<'e, 'a, 'm, 'pm> NativeCallContext<'e, 'a, 'm, 'pm>
[src]
pub fn new(engine: &'e Engine, lib: &'m impl AsRef<[&'pm Module]>) -> Self
[src]
Create a new NativeCallContext
.
pub fn new_with_imports(
engine: &'e Engine,
mods: &'a mut Imports,
lib: &'m impl AsRef<[&'pm Module]>
) -> Self
[src]
engine: &'e Engine,
mods: &'a mut Imports,
lib: &'m impl AsRef<[&'pm Module]>
) -> Self
(INTERNALS) Create a new NativeCallContext
.
Available under the internals
feature only.
pub fn engine(&self) -> &'e Engine
[src]
The current Engine
.
pub fn imports(&self) -> Option<&Imports>
[src]
(INTERNALS) The current set of modules imported via import
statements.
Available under the internals
feature only.
pub fn iter_namespaces(&self) -> impl Iterator<Item = &'pm Module> + 'm
[src]
Get an iterator over the namespaces containing definition of all script-defined functions.
pub fn call_fn_dynamic_raw(
&self,
fn_name: &str,
is_method: bool,
public_only: bool,
args: &mut [&mut Dynamic],
def_value: Option<&Dynamic>
) -> Result<Dynamic, Box<EvalAltResult>>
[src]
&self,
fn_name: &str,
is_method: bool,
public_only: bool,
args: &mut [&mut Dynamic],
def_value: Option<&Dynamic>
) -> Result<Dynamic, Box<EvalAltResult>>
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<'e, 'a, 'm, 'pm: 'm> Clone for NativeCallContext<'e, 'a, 'm, 'pm>
[src]
pub fn clone(&self) -> NativeCallContext<'e, 'a, 'm, 'pm>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'e, 'a, 'm, 'pm: 'm> Copy for NativeCallContext<'e, 'a, 'm, 'pm>
[src]
impl<'e, 'a, 'm, 'pm: 'm> Debug for NativeCallContext<'e, 'a, 'm, 'pm>
[src]
impl<'e, 'a, 'm, 'pm: 'm, M: AsRef<[&'pm Module]> + ?Sized> From<(&'e Engine, &'a Imports, &'m M)> for NativeCallContext<'e, 'a, 'm, 'pm>
[src]
impl<'e, 'm, 'pm: 'm, M: AsRef<[&'pm Module]> + ?Sized, '_> From<(&'e Engine, &'m M)> for NativeCallContext<'e, '_, 'm, 'pm>
[src]
Auto Trait Implementations
impl<'e, 'a, 'm, 'pm> !RefUnwindSafe for NativeCallContext<'e, 'a, 'm, 'pm>
impl<'e, 'a, 'm, 'pm> !Send for NativeCallContext<'e, 'a, 'm, 'pm>
impl<'e, 'a, 'm, 'pm> !Sync for NativeCallContext<'e, 'a, 'm, 'pm>
impl<'e, 'a, 'm, 'pm> Unpin for NativeCallContext<'e, 'a, 'm, 'pm> where
'pm: 'm,
'pm: 'm,
impl<'e, 'a, 'm, 'pm> !UnwindSafe for NativeCallContext<'e, 'a, 'm, 'pm>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow(&self) -> &TⓘNotable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,