We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
push_into_stack
from_stack
bool
1 parent dfd82ed commit 5129214Copy full SHA for 5129214
src/conversion.rs
@@ -434,6 +434,12 @@ impl<'lua> IntoLua<'lua> for bool {
434
fn into_lua(self, _: &'lua Lua) -> Result<Value<'lua>> {
435
Ok(Value::Boolean(self))
436
}
437
+
438
+ #[inline]
439
+ unsafe fn push_into_stack(self, lua: &'lua Lua) -> Result<()> {
440
+ ffi::lua_pushboolean(lua.state(), self as c_int);
441
+ Ok(())
442
+ }
443
444
445
impl<'lua> FromLua<'lua> for bool {
@@ -445,6 +451,10 @@ impl<'lua> FromLua<'lua> for bool {
451
_ => Ok(true),
446
452
447
453
454
455
+ unsafe fn from_stack(idx: c_int, lua: &'lua Lua) -> Result<Self> {
456
+ Ok(ffi::lua_toboolean(lua.state(), idx) != 0)
457
448
458
449
459
450
460
impl<'lua> IntoLua<'lua> for LightUserData {
0 commit comments