Struct rhai::module_resolvers::ModuleResolversCollection[][src]

pub struct ModuleResolversCollection(_);
Expand description

Module resolution service that holds a collection of module resolvers, to be searched in sequential order.

Example

use rhai::{Engine, Module};
use rhai::module_resolvers::{StaticModuleResolver, ModuleResolversCollection};

let mut collection = ModuleResolversCollection::new();

let resolver = StaticModuleResolver::new();
collection.push(resolver);

let mut engine = Engine::new();
engine.set_module_resolver(collection);

Implementations

Create a new ModuleResolversCollection.

Example

use rhai::{Engine, Module};
use rhai::module_resolvers::{StaticModuleResolver, ModuleResolversCollection};

let mut collection = ModuleResolversCollection::new();

let resolver = StaticModuleResolver::new();
collection.push(resolver);

let mut engine = Engine::new();
engine.set_module_resolver(collection);

Append a module resolver to the end.

Insert a module resolver to an offset index.

Panics

Panics if the index is out of bounds.

Remove the last module resolver from the end, if any.

Remove a module resolver at an offset index.

Panics

Panics if the index is out of bounds.

Get an iterator of all the module resolvers.

Remove all module resolvers.

Get the number of module resolvers in this ModuleResolversCollection.

Add another ModuleResolversCollection to the end of this collection. The other ModuleResolversCollection is consumed.

Trait Implementations

Performs the += operation. Read more

Returns the “default value” for a type. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Resolve a module based on a path string.

Resolve an AST based on a path string. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.