[−][src]Struct rhai::module_resolvers::ModuleResolversCollection
Module resolution service that holds a collection of module resolves, 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(Some(collection));
Implementations
impl ModuleResolversCollection
[src]
pub fn new() -> Self
[src]
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(Some(collection));
pub fn push(&mut self, resolver: impl ModuleResolver + 'static)
[src]
Add a module keyed by its path.
pub fn iter(&self) -> impl Iterator<Item = &dyn ModuleResolver>
[src]
Get an iterator of all the module resolvers.
pub fn into_iter(self) -> impl Iterator<Item = Box<dyn ModuleResolver>>
[src]
Get a mutable iterator of all the modules.
pub fn clear(&mut self)
[src]
Remove all module resolvers.
pub fn is_empty(&self) -> bool
[src]
Is this ModuleResolversCollection
empty?
pub fn len(&self) -> usize
[src]
Get the number of module resolvers in this ModuleResolversCollection
.
pub fn append(&mut self, other: Self)
[src]
Add another ModuleResolversCollection
to the end of this collection.
The other ModuleResolversCollection
is consumed.
Trait Implementations
impl<M: ModuleResolver + 'static> AddAssign<M> for ModuleResolversCollection
[src]
fn add_assign(&mut self, rhs: M)
[src]
impl Default for ModuleResolversCollection
[src]
impl ModuleResolver for ModuleResolversCollection
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ModuleResolversCollection
impl !Send for ModuleResolversCollection
impl !Sync for ModuleResolversCollection
impl Unpin for ModuleResolversCollection
impl !UnwindSafe for ModuleResolversCollection
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<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
[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<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
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<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
[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<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,