Struct hlua_badtouch::PushGuard
[−]
[src]
pub struct PushGuard<L> { /* fields omitted */ }
RAII guard for a value pushed on the stack.
You shouldn't have to manipulate this type directly unless you are fiddling with the library's internals.
Methods
impl<'lua, L> PushGuard<L> where
L: AsMutLua<'lua>,
[src]
L: AsMutLua<'lua>,
pub unsafe fn new(lua: L, size: i32) -> Self
[src]
Creates a new PushGuard
from this Lua context representing size
items on the stack.
When this PushGuard
is destroyed, size
items will be popped.
This is unsafe because the Lua stack can be corrupted if this is misused.
pub fn size(&self) -> i32
[src]
Returns the number of elements managed by this PushGuard
.
pub unsafe fn forget(self) -> i32
[src]
Prevents the value from being popped when the PushGuard
is destroyed, and returns the
number of elements on the Lua stack.
This is unsafe because the Lua stack can be corrupted if this is misused.
pub fn into_inner(self) -> L
[src]
Destroys the guard, popping the value. Returns the inner part, which returns access when using by-value capture.
Trait Implementations
impl<L: Debug> Debug for PushGuard<L>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'lua, L> AsLua<'lua> for PushGuard<L> where
L: AsMutLua<'lua>,
[src]
L: AsMutLua<'lua>,
fn as_lua(&self) -> LuaContext
[src]
impl<'lua, L> AsMutLua<'lua> for PushGuard<L> where
L: AsMutLua<'lua>,
[src]
L: AsMutLua<'lua>,
fn as_mut_lua(&mut self) -> LuaContext
[src]
Returns the raw Lua context.