pub struct AmountReturned(/* private fields */);Expand description
Simple wrapper that tells Lua how many values a CFunction is intending to return.
Without this wrapper, Lua would willingly attempt to return as many values as you say, which can easily go beyond the stack and result in undefined behavior.
This wrapper can only be (safely) created by LuaState,
which will check if the amount is valid before returning the AmountReturned (see LuaState::finish).
Implementations§
Source§impl AmountReturned
impl AmountReturned
Auto Trait Implementations§
impl Freeze for AmountReturned
impl RefUnwindSafe for AmountReturned
impl Send for AmountReturned
impl Sync for AmountReturned
impl Unpin for AmountReturned
impl UnsafeUnpin for AmountReturned
impl UnwindSafe for AmountReturned
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more