summaryrefslogtreecommitdiff
path: root/src/lua.rs
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2023-07-11 20:03:41 +0100
committerAlex Orlenko <zxteam@protonmail.com>2023-07-11 20:03:41 +0100
commit9f0fc27c52c5560deff67893569387f4e909ed68 (patch)
tree7062887b2c9c354e7d86d2f426c30f333597f56c /src/lua.rs
parentbfd1c29c0ad24a2be291415fd1a9d91102dd19de (diff)
downloadmlua-9f0fc27c52c5560deff67893569387f4e909ed68.zip
Make `Lua::push_value()` and `Lua::pop_value()` public (but hidden from the docs).
Can be useful for low-level intergration with mlua values. Also closes #215.
Diffstat (limited to 'src/lua.rs')
-rw-r--r--src/lua.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lua.rs b/src/lua.rs
index 24544da..cfc167e 100644
--- a/src/lua.rs
+++ b/src/lua.rs
@@ -2295,8 +2295,11 @@ impl Lua {
extra.app_data.remove()
}
- // Uses 2 stack spaces, does not call checkstack
- pub(crate) unsafe fn push_value(&self, value: Value) -> Result<()> {
+ /// Pushes a value onto the Lua stack.
+ ///
+ /// Uses 2 stack spaces, does not call checkstack.
+ #[doc(hidden)]
+ pub unsafe fn push_value(&self, value: Value) -> Result<()> {
let state = self.state();
match value {
Value::Nil => {
@@ -2356,8 +2359,11 @@ impl Lua {
Ok(())
}
- // Uses 2 stack spaces, does not call checkstack
- pub(crate) unsafe fn pop_value(&self) -> Value {
+ /// Pops a value from the Lua stack.
+ ///
+ /// Uses 2 stack spaces, does not call checkstack.
+ #[doc(hidden)]
+ pub unsafe fn pop_value(&self) -> Value {
let state = self.state();
match ffi::lua_type(state, -1) {
ffi::LUA_TNIL => {