tomaka / hlua

Rust library to interface with Lua
MIT License
507 stars 48 forks source link

expose unsafe methods to create and forget PushGuards #163

Closed sunshowers closed 7 years ago

sunshowers commented 7 years ago

This is most useful when poking at the Lua state directly.

The most important methods made public are new to create a new PushGuard, and forget to not run this PushGuard's destructor. They're both unsafe because their misuse can easily cause the Lua stack to be out of sync with Rust PushGuards.

Also expose a size method to access the number of elements this PushGuard is managing, and provide an internal-only safe version of forget under the assumption that consumers within this crate know what they're doing.