[−][src]Struct rhai::module_resolvers::StaticModuleResolver
Module resolution service that serves modules added into it.
Examples
use rhai::{Engine, Module}; use rhai::module_resolvers::StaticModuleResolver; let mut resolver = StaticModuleResolver::new(); let module = Module::new(); resolver.insert("hello".to_string(), module); let mut engine = Engine::new(); engine.set_module_resolver(Some(resolver));
Implementations
impl StaticModuleResolver
[src]
pub fn new() -> Self
[src]
Create a new StaticModuleResolver
.
Examples
use rhai::{Engine, Module}; use rhai::module_resolvers::StaticModuleResolver; let mut resolver = StaticModuleResolver::new(); let module = Module::new(); resolver.insert("hello", module); let mut engine = Engine::new(); engine.set_module_resolver(Some(resolver));
impl StaticModuleResolver
[src]
pub fn insert<S: Into<String>>(&mut self, path: S, module: Module)
[src]
Add a module keyed by its path.
pub fn remove(&mut self, path: &str) -> Option<Module>
[src]
Remove a module given its path.
pub fn contains_path(&self, path: &str) -> bool
[src]
Does the path exist?
pub fn iter(&self) -> impl Iterator<Item = (&str, &Module)>
[src]
Get an iterator of all the modules.
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&str, &mut Module)>
[src]
Get a mutable iterator of all the modules.
pub fn paths(&self) -> impl Iterator<Item = &str>
[src]
Get an iterator of all the module paths.
pub fn values(&self) -> impl Iterator<Item = &Module>
[src]
Get an iterator of all the modules.
pub fn values_mut(&mut self) -> impl Iterator<Item = &mut Module>
[src]
Get a mutable iterator of all the modules.
pub fn clear(&mut self)
[src]
Remove all modules.
Trait Implementations
impl Clone for StaticModuleResolver
[src]
fn clone(&self) -> StaticModuleResolver
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for StaticModuleResolver
[src]
impl Default for StaticModuleResolver
[src]
fn default() -> StaticModuleResolver
[src]
impl ModuleResolver for StaticModuleResolver
[src]
Auto Trait Implementations
impl !RefUnwindSafe for StaticModuleResolver
impl !Send for StaticModuleResolver
impl !Sync for StaticModuleResolver
impl Unpin for StaticModuleResolver
impl !UnwindSafe for StaticModuleResolver
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,
fn borrow(&self) -> &TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,