pub struct PushGuard<L> where
    L: AsLua
{ /* private fields */ }
Expand description

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.

Implementations

Creates a new PushGuard from this Lua context representing size items on the stack. When this PushGuard is destroyed, size items will be popped.

Safety

There must be at least size elements on the lua stack and it must be safe to drop them at the same time with this PushGuard.

Returns the number of elements managed by this PushGuard.

Prevents the value from being popped when the PushGuard is destroyed, and returns the number of elements on the Lua stack.

Safety

The values on the stack will not be popped automatically, so the caller must ensure nothing is leaked.

Destroys the guard, popping the value. Returns the inner part, which returns access when using by-value capture.

Trait Implementations

Try to push v onto the lua stack. Read more

Push v onto the lua stack. Read more

Try to push v onto the lua stack. Read more

Push v onto the lua stack. Read more

Push iterator onto the lua stack as a lua table. Read more

Push iterator onto the lua stack as a lua table. Read more

Call a rust function in protected mode. If a lua error is thrown during execution of f the function will return a LuaError. Read more

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.