[][src]Trait include_lua::ContextExt

pub trait ContextExt<'a> {
    fn add_modules(&self, modules: LuaModules) -> Result<()>;
fn add_modules_with_env(
        &self,
        modules: LuaModules,
        environment: Table<'a>
    ) -> Result<()>;
fn make_searcher(&self, modules: LuaModules) -> Result<Searcher>;
fn make_searcher_with_env(
        &self,
        modules: LuaModules,
        environment: Table<'a>
    ) -> Result<Searcher>; }

An extension trait for Context that allows the loading of LuaModules instances.

Required methods

fn add_modules(&self, modules: LuaModules) -> Result<()>

Makes the source tree represented by modules accessible to require calls within this context.

fn add_modules_with_env(
    &self,
    modules: LuaModules,
    environment: Table<'a>
) -> Result<()>

Makes the source tree represented by modules accessible to require calls within this context. All modules loaded from the source tree will have their environment set to environment.

fn make_searcher(&self, modules: LuaModules) -> Result<Searcher>

Creates a Searcher instance from the given LuaModules instance.

fn make_searcher_with_env(
    &self,
    modules: LuaModules,
    environment: Table<'a>
) -> Result<Searcher>

Creates a Searcher instance from the given LuaModules instance. All modules loaded by the searcher will have their environment set to environment.

Loading content...

Implementations on Foreign Types

impl<'a> ContextExt<'a> for Context<'a>[src]

Loading content...

Implementors

Loading content...