pub trait AsChunk<'lua, 'a> {
// Required method
fn source(self) -> Result<Cow<'a, [u8]>, Error>;
// Provided methods
fn name(&self) -> Option<String> { ... }
fn environment(&self, lua: &'lua Lua) -> Result<Option<Table<'lua>>, Error> { ... }
fn mode(&self) -> Option<ChunkMode> { ... }
}
Expand description
Trait for types loadable by Lua and convertible to a Chunk
Required Methods§
Provided Methods§
sourcefn environment(&self, lua: &'lua Lua) -> Result<Option<Table<'lua>>, Error>
fn environment(&self, lua: &'lua Lua) -> Result<Option<Table<'lua>>, Error>
Returns optional chunk environment