Trait ModuleFields

Source
pub trait ModuleFields<'lua> {
    // Required methods
    fn add_field<K, V>(&mut self, name: K, value: V) -> Result<()>
       where K: IntoLua<'lua>,
             V: IntoLua<'lua>;
    fn add_meta_field<K, V>(&mut self, name: K, value: V) -> Result<()>
       where K: IntoLua<'lua>,
             V: IntoLua<'lua>;
    fn add_module<K, V>(&mut self, name: K) -> Result<()>
       where K: IntoLua<'lua>,
             V: Module;
}
Expand description

Add table fields for a module

Required Methods§

Source

fn add_field<K, V>(&mut self, name: K, value: V) -> Result<()>
where K: IntoLua<'lua>, V: IntoLua<'lua>,

Add a field to the module’s table

Source

fn add_meta_field<K, V>(&mut self, name: K, value: V) -> Result<()>
where K: IntoLua<'lua>, V: IntoLua<'lua>,

Add a field to the module’s metatable

Source

fn add_module<K, V>(&mut self, name: K) -> Result<()>
where K: IntoLua<'lua>, V: Module,

Add a nested module as a table in this module

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'lua> ModuleFields<'lua> for ModuleBuilder<'lua>