Struct rhai::Imports[][src]

pub struct Imports { /* fields omitted */ }

(INTERNALS) A stack of imported modules. Exported under the internals feature only.

Volatile Data Structure

This type is volatile and may change.

Implementations

impl Imports[src]

pub fn len(&self) -> usize[src]

Get the length of this stack of imported modules.

pub fn is_empty(&self) -> bool[src]

Is this stack of imported modules empty?

pub fn get(&self, index: usize) -> Option<Shared<Module>>[src]

Get the imported modules at a particular index.

pub fn find(&self, name: &str) -> Option<usize>[src]

Get the index of an imported modules by name.

pub fn push(
    &mut self,
    name: impl Into<Identifier>,
    module: impl Into<Shared<Module>>
)
[src]

Push an imported modules onto the stack.

pub fn truncate(&mut self, size: usize)[src]

Truncate the stack of imported modules to a particular length.

pub fn iter(&self) -> impl Iterator<Item = (&str, &Module)>[src]

Get an iterator to this stack of imported modules in reverse order.

pub fn into_iter(self) -> impl Iterator<Item = (Identifier, Shared<Module>)>[src]

Get a consuming iterator to this stack of imported modules in reverse order.

pub fn contains_fn(&self, hash: u64) -> bool[src]

Does the specified function hash key exist in this stack of imported modules?

pub fn get_fn(
    &self,
    hash: u64
) -> Option<(&CallableFunction, Option<&Identifier>)>
[src]

Get specified function via its hash key.

pub fn contains_iter(&self, id: TypeId) -> bool[src]

Does the specified TypeId iterator exist in this stack of imported modules?

pub fn get_iter(
    &self,
    id: TypeId
) -> Option<fn(_: Dynamic) -> Box<dyn Iterator<Item = Dynamic>>>
[src]

Get the specified TypeId iterator.

Trait Implementations

impl Clone for Imports[src]

impl Debug for Imports[src]

impl Default for Imports[src]

Auto Trait Implementations

impl !RefUnwindSafe for Imports

impl !Send for Imports

impl !Sync for Imports

impl Unpin for Imports

impl !UnwindSafe for Imports

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.