[][src]Struct rhai::Imports

pub struct Imports(_);

[INTERNALS] A stack of imported modules. Exported under the internals feature only.

WARNING

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<Rc<Module>>[src]

Get the imported module at a particular index.

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

Get the index of an imported module by name.

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

Push an imported module 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, Rc<Module>)>[src]

Get an iterator to this stack of imported modules.

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

Get a consuming iterator to this stack of imported modules.

pub fn extend(
    &mut self,
    stream: impl Iterator<Item = (ImmutableString, Rc<Module>)>
)
[src]

Add a stream of imported modules.

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.