format comments
This commit is contained in:
parent
dd252db5c8
commit
357f2b6fdd
@ -123,13 +123,13 @@ pub struct ClosureSearcher {
|
|||||||
///
|
///
|
||||||
/// 1. An `rlua::Context`, which the closure can do what it wants with.
|
/// 1. An `rlua::Context`, which the closure can do what it wants with.
|
||||||
///
|
///
|
||||||
/// 2. An `rlua::Table` containing globals (i.e. Lua's `_G`), which can be passed
|
/// 2. An `rlua::Table` containing globals (i.e. Lua's `_G`), which can be passed to
|
||||||
/// to `Chunk.set_environment()`.
|
/// `Chunk.set_environment()`.
|
||||||
///
|
///
|
||||||
/// 3. The name of the module to be loaded (`&str`).
|
/// 3. The name of the module to be loaded (`&str`).
|
||||||
///
|
///
|
||||||
/// Closures must return an `rlua::Result`-wrapped `Function`. This `Function`
|
/// Closures must return an `rlua::Result`-wrapped `Function`. This `Function` acts as
|
||||||
/// acts as the module loader.
|
/// the module loader.
|
||||||
modules: HashMap<
|
modules: HashMap<
|
||||||
Cow<'static, str>,
|
Cow<'static, str>,
|
||||||
Box<
|
Box<
|
||||||
@ -178,8 +178,8 @@ impl UserData for ClosureSearcher {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Like `Searcher`, but with function pointers as `modules` values, to facilitate
|
/// Like `Searcher`, but with function pointers as `modules` values, to facilitate setting
|
||||||
/// setting up an `rlua::Context` with Rust code.
|
/// up an `rlua::Context` with Rust code.
|
||||||
///
|
///
|
||||||
/// Enables exposing `UserData` types to an `rlua::Context`.
|
/// Enables exposing `UserData` types to an `rlua::Context`.
|
||||||
pub struct FunctionSearcher {
|
pub struct FunctionSearcher {
|
||||||
@ -187,13 +187,13 @@ pub struct FunctionSearcher {
|
|||||||
///
|
///
|
||||||
/// 1. An `rlua::Context`, which the function body can do what it wants with.
|
/// 1. An `rlua::Context`, which the function body can do what it wants with.
|
||||||
///
|
///
|
||||||
/// 2. An `rlua::Table` containing globals (i.e. Lua's `_G`), which can be passed
|
/// 2. An `rlua::Table` containing globals (i.e. Lua's `_G`), which can be passed to
|
||||||
/// to `Chunk.set_environment()`.
|
/// `Chunk.set_environment()`.
|
||||||
///
|
///
|
||||||
/// 3. The name of the module to be loaded (`&str`).
|
/// 3. The name of the module to be loaded (`&str`).
|
||||||
///
|
///
|
||||||
/// Functions must return an `rlua::Result`-wrapped `Function`. This `Function`
|
/// Functions must return an `rlua::Result`-wrapped `Function`. This `Function` acts
|
||||||
/// acts as the module loader.
|
/// as the module loader.
|
||||||
modules: HashMap<
|
modules: HashMap<
|
||||||
Cow<'static, str>,
|
Cow<'static, str>,
|
||||||
for<'ctx> fn(Context<'ctx>, Table<'ctx>, &str) -> rlua::Result<Function<'ctx>>,
|
for<'ctx> fn(Context<'ctx>, Table<'ctx>, &str) -> rlua::Result<Function<'ctx>>,
|
||||||
@ -238,9 +238,9 @@ impl UserData for FunctionSearcher {
|
|||||||
|
|
||||||
/// Extend `rlua::Context` to support `require`ing Lua modules by name.
|
/// Extend `rlua::Context` to support `require`ing Lua modules by name.
|
||||||
pub trait AddSearcher {
|
pub trait AddSearcher {
|
||||||
/// Add a `HashMap` of Lua modules indexed by module name to Lua's
|
/// Add a `HashMap` of Lua modules indexed by module name to Lua's `package.searchers`
|
||||||
/// `package.searchers` table in an `rlua::Context`, with lookup functionality
|
/// table in an `rlua::Context`, with lookup functionality provided by the
|
||||||
/// provided by the `rlua_searcher::Searcher` struct.
|
/// `rlua_searcher::Searcher` struct.
|
||||||
fn add_searcher(&self, modules: HashMap<Cow<'static, str>, Cow<'static, str>>) -> Result<()>;
|
fn add_searcher(&self, modules: HashMap<Cow<'static, str>, Cow<'static, str>>) -> Result<()>;
|
||||||
|
|
||||||
/// Like `add_searcher`, but with `modules` values given as paths to files containing
|
/// Like `add_searcher`, but with `modules` values given as paths to files containing
|
||||||
@ -249,8 +249,8 @@ pub trait AddSearcher {
|
|||||||
where
|
where
|
||||||
P: 'static + AsRef<Path> + Send;
|
P: 'static + AsRef<Path> + Send;
|
||||||
|
|
||||||
/// Like `add_path_searcher`, but with user-provided closure for transforming
|
/// Like `add_path_searcher`, but with user-provided closure for transforming source
|
||||||
/// source code to Lua.
|
/// code to Lua.
|
||||||
fn add_path_searcher_poly<P>(
|
fn add_path_searcher_poly<P>(
|
||||||
&self,
|
&self,
|
||||||
modules: HashMap<Cow<'static, str>, P>,
|
modules: HashMap<Cow<'static, str>, P>,
|
||||||
|
Loading…
Reference in New Issue
Block a user