Struct rlua::prelude::LuaRegistryKey
[−]
[src]
pub struct LuaRegistryKey { /* fields omitted */ }
An auto generated key into the Lua registry.
This is a handle into a value stored inside the Lua registry, similar to the normal handle types
like Table
or Function
. The difference is that this handle does not require holding a
reference to a parent Lua
instance, and thus is managed differently. Though it is more
difficult to use than the normal handle types, it is Send + Sync + 'static, which means that it
can be used in many situations where it would be impossible to store a regular handle value.
Be warned, If you place this into Lua via a UserData
type, it is very easy to accidentally
cause reference cycles that the Lua garbage collector cannot resolve. Instead of placing a
RegistryKey
into a UserData
type, prefer instead to use UserData::set_user_value
/
UserData::get_user_value
.