pub trait AsChunk<'lua> {
    fn source(&self) -> Result<Cow<'_, [u8]>, Error>;

    fn name(&self) -> Option<String> { ... }
    fn env(&self, _lua: &'lua Lua) -> Result<Option<Value<'lua>>, Error> { ... }
    fn mode(&self) -> Option<ChunkMode> { ... }
}
Expand description

Trait for types loadable by Lua and convertible to a Chunk

Required Methods

Returns chunk data (can be text or binary)

Provided Methods

Returns optional chunk name

Returns optional chunk environment

Returns optional chunk mode (text or binary)

Implementations on Foreign Types

Implementors