[][src]Struct rhai::NativeCallContext

pub struct NativeCallContext<'e, 'a, 'm, 'pm: 'm> { /* fields omitted */ }

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]

(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]

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]

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, 

impl<'e, 'a, 'm, 'pm> !UnwindSafe for NativeCallContext<'e, 'a, 'm, 'pm>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.