Skip to main content

LuaStaticMethodProvider

Trait LuaStaticMethodProvider 

Source
pub trait LuaStaticMethodProvider {
    // Provided method
    fn __lua_static_methods() -> &'static [(&'static str, CFunction)] { ... }
}
Expand description

Blanket trait providing a default empty static methods list.

When #[lua_methods] is used on an impl block that contains associated functions (no self), it generates an inherent __lua_static_methods() function on the type that shadows this trait’s default.

Used by LuaState::register_type::<T>(name) to populate the class table.

Provided Methods§

Source

fn __lua_static_methods() -> &'static [(&'static str, CFunction)]

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§